Repository navigation
Material blend modes. - #297
Open
tychedelia wants to merge 1 commit into
Open
tychedelia wants to merge 1 commit into
tychedelia wants to merge 1 commit into
Conversation
tychedelia
force-pushed
the
blend-modes
branch
from
November 30, 2026 22:13
6ae34f9 to
9185414
Compare
tychedelia
force-pushed
the
blend-modes
branch
from
November 30, 2026 22:31
9185414 to
2a6ede1
Compare
tychedelia
marked this pull request as ready for review
November 30, 2026 22:34
|
Visual regression: 1 changed, 2 new of 45 cases
If these changes are intentional, add the baseline |
This branch has not been deployed
This file contains hidden or 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
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.
Cleans up how materials specify a blend mode.
Previously there were two overlapping ways to do this,
mat.transparent()/mat.opaque()andmat.blend_mode(..), which under the hood was just an int for a pre-computed blend mode.The new way:
mat.blend_mode(mode)is the only way to say how a material should blend.modeisOPAQUE,BLEND,ADDand the other presets,PREMULTIPLIED, or a customBlendMode(...)in Python.blend_mode(OPAQUE)forces everything opaque regardless of the fill's alpha.mat.mask(cutoff)stays as its own thing since it isn't blending, plusmat.no_mask(). We should add an image mask here to our shader extension in the future.mat.opaque(),mat.transparent()and thealpha_mode=kwarg are gone.The engine API matches:
material_set_blend_modeandmaterial_set_maskreplace the numbered material_set_alpha_mode`, and the C and Node bindings follow.Stack created with GitHub Stacks CLI • Give Feedback 💬