Skip to content
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 support for group layer blending #1077

Merged

Conversation

OverloadedOrama
Copy link
Member

@OverloadedOrama OverloadedOrama commented Aug 11, 2024

Layers that belong to the same group are now being blended together into a single texture, which represents the entire group. Layers outside the group are not affecting the group's blended texture. This has several advantages:

  • Group layers can have their own blend modes.
  • Group layers can both act as a clipping mask and be used by a clipping mask.
  • Group layers and cels now have their own opacity.
  • Group layer effects are no longer being applied recursively to each of its children, but instead they are being applied once in the final blended texture. This allows us to use some modern non-destructive techniques, such as HD Index Painting with dithering support. https://www.youtube.com/watch?v=7Q36EyvaYG8
  • A new "pass through" blending mode has been added that is only available for group layers. If that is selected, the children of the group are not being blended together, and instead it acts as if the group doesn't exist.

image
Recreating the HD Index Painting technique shown in the video I linked above. "Layer 1" is the black and white layer where we draw, "Layer 3" is the dithering pattern, and they are both being blended together by "Group 2", which contains a posterize and a gradient map layer effect.

2024-08-11.19-47-30.mp4

Group 3, containing a pixel and a 3D layer, is being used by Layer 2 which acts as a clipping mask.

Bugs fixed:

  • Layer effects on group layers now automatically update the canvas the moment they are enabled/disabled.
  • Changing a layer's blend mode, clipping mask status, opacity and a cel's opacity now automatically update the canvas, if these layers or cels are not currently selected.

This PR effectively makes group layers actually affect the blending process, rather than having group layers simply be for organization purposes and do nothing. However, it might be a good idea to introduce a "pass through" blend mode that exists only for group layers, which would restore the previous behavior and make group layers have no effect on the blending process.

EDIT: Done

Fingers crossed that no bugs were introduced
… their textures on the canvas automatically on undo
@OverloadedOrama
Copy link
Member Author

Should be good to get merged, I didn't find any issues on my testing. Performance could use some work in the future though.

@OverloadedOrama OverloadedOrama merged commit 077c57c into Orama-Interactive:master Aug 15, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant