-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
Layer blend modes #911
Merged
OverloadedOrama
merged 14 commits into
Orama-Interactive:master
from
OverloadedOrama:blend-modes
Oct 21, 2023
Merged
Layer blend modes #911
OverloadedOrama
merged 14 commits into
Orama-Interactive:master
from
OverloadedOrama:blend-modes
Oct 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
No support for exporting and layer merging yet. Also need to fix the move tool preview.
I think I will merge this PR as it is so it will get tested more as part of the master branch, and potential issues can be fixed later. For now, it should be stable enough. |
OverloadedOrama
merged commit Oct 21, 2023
8de9697
into
Orama-Interactive:master
3 of 4 checks passed
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.
Alternative to #688, much more straightforward way to handle layer blending now that we use Godot 4, but I would really appreciate feedback as I'm not sure if this is the best way to handle layer blending and if it has any disadvantages over any other methods. CC @AlphinAlbukhari @mrtripie.
I also didn't encounter any layer limit with this method, I tested up to 300 layers and it seemed to be working perfectly with no performance issue. I did have to add a 1024 layer limit though in order to pass opacities and blend modes for each layer as arrays to the shader, since shaders don't support uniform arrays with unknown sizes. I am worried that 1024 might be too high for certain GPUs, so we may have to lower the number even more. Alternatively, we could either pass opacities and blend modes as textures, where each pixel would represent a layer, or we could change the shader code during runtime to update the size of the array, although I am worried this might affect performance as we would re-generate the shader every time we add or remove a layer.
Current blending modes supported (thanks to #688 and https://godotshaders.com/snippet/blending-modes/):
This PR only works as a preview, I would like feedback first to ensure that this method is indeed a good one before I continue the work.
To-do:
Can be done after this PR is merged: