-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement layer effects #940
Merged
OverloadedOrama
merged 26 commits into
Orama-Interactive:master
from
OverloadedOrama:layers-fx
Nov 21, 2023
Merged
Implement layer effects #940
OverloadedOrama
merged 26 commits into
Orama-Interactive:master
from
OverloadedOrama:layers-fx
Nov 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…change properties of effects yet
…xes to checkbuttons
OverloadedOrama
force-pushed
the
layers-fx
branch
from
November 15, 2023 12:22
ab0f47c
to
20a18f9
Compare
There are some errors due to the usage of anonymous lambda methods in undo/redo, but it seems to be working well regardless.
Should be finished for now. I just implemented undo/redo support, as well as a way to permanently apply effects (destructively) to all cels of the layer. The main thing missing is pxo saving, but this can be handled after we deal with #939. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduces a non-destructive workflow for effects/filters as proposed in #619.
2023-11-11.17-08-22.mp4
2023-11-11.17-07-18.mp4
All it does is essentially takes a copy of the images of the cels, uses
ShaderImageEffect
to apply each shader of every effect into the copy, and display that copy to the canvas (if Display Layer Effects is enabled) and to the exported image. The image data of the cels are not affected in any way, thus making it non-destructive.The biggest issue with this system is performance. Drawing is noticeably laggier when effects are enabled, and this is due to
RenderingServer.force_draw()
thatShaderImageEffect
is using. This method is necessary however, without it the resulting image is blank. A better solution may be this godotengine/godot#75436, or to use something like this godotengine/godot-proposals#7379.The UI is different than the one proposed in #619, because I used a newer mockup by mrtripie which was posted on our Discord server. Feel free to give feedback!
To avoid code duplication with the destructive image effect UI and to future-proof the system, the parameter UI of the effects is being generated on the fly by reading the shader code and making the appropriate UI elements for each uniform (ValueSliders for ints and floats, CheckBoxes for bools, ColorPickerButtons for vec4s, etc). This system is future-proofed in the sense that we 1) don't have to update the UI every time a shader changes (although we have to do it anyway for the destructive image effects as of right now), and 2) it supports custom shaders loaded by the user, whenever we implement this feature.
Features not yet implemented, not inside this PR's scope:
Save the effect data on pxo, as well as the result images for easier importing (by third-party software) and exporting. Probably not going to work on it since the pxo format is subject to change, see Change the file format of pxo files #939.EDIT: This was implemented later, after this PR got merged, in 8c34532.
.gdshader
files, and for every shader file we would add both a destructive effect in the Image menu, and a non-destructive layer effect.- A way to permanently apply effects.EDIT: Implemented in cc8d18c and 5f7ae70.