Repository navigation
Fix nested Container picking up a sibling's blend mode - #7407
Merged
photonstorm merged 1 commit intoDec 1, 2026
Merged
Conversation
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.
Please do not update the README or Change Log, we will do this when we merge your PR.
This PR (delete as applicable)
Describe the changes below:
Fixes #7387.
This is #7201 coming back. 6f5c7a1 fixed it with an
elsethat went back tobaseContextfor every child that didn't need a new context. c95e399 removed thatelsebecause it also reset a second sibling with the same blend mode, but that leftSKIP_CHECKchildren with nothing to reset them. So a nested Container after anADDsibling gets theADDcontext, and when it has a mask or other filter its result is composited withADD.Now a
SKIP_CHECKchild goes back tobaseContext, and a child with its own blend mode still only clones when the mode changes, so consecutive siblings with the same mode keep it.Tested in Chromium with the repro from the issue using generated textures: a blue square inside the masked inner container over a grey background.
In the same scene, two
ADDsiblings in a row and anADDsibling after the inner container render the same before and after.Added two tests to
ContainerWebGLRenderer.test.js: one for theSKIP_CHECKchild after a blended sibling, which fails before this change, and one for consecutive siblings with the same blend mode.tests/gameobjects/containerandtests/gameobjects/layerpass.LayerWebGLRendererhas the same condition but clones fromcurrentContext, so I left it out of this PR.