fix(player): carry instance-internal masks out to the parent's later parts - #295
Merged
Merged
Conversation
…parts An instance child's clipping writers (write_mask normal parts) never reached the parent's coverage, so parts drawn after the instance were not clipped by masks written inside the sub-animation. Bubble each visible instance child's clipping writers into the owner's coverage, transformed by the slot matrix and ranked at the instance part; run the coverage pass even when the parent owns no writer of its own. Compose each bubbled writer's op with the influence handed down (a mask_influence==0 instance drops its writers onto the union plane). Also stop mask_write from forcing a clipping part to be a mask target — target-ness is the composed mask_influence alone (Rule_Mask.md 2-3/3).
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.
What
Fixes SS7.5 mask propagation across instance (sub-animation) parts, ported from the same three bugs found and fixed in the stencil-based ForUnity player. Player-only change (
ss_internal_player.{cpp,h}); no runtime/shader/submodule change. Ground truth is SS7.5; verified visually againsttests/overall/InstancePropagation.The three fixes
Carry-over (main) — an instance child's clipping writers (
write_masknormal parts) never reached the parent's coverage, so parts drawn after the instance (e.g.Arrow*) were not clipped by masks written inside the sub-animation. The parent's_render_mask_coveragenow bubbles each visible instance child's clipping writers into its own coverage, transformed by the slot matrix and ranked at the instance part (so they clip the owner parts drawn after it). The coverage pass also runs when the parent owns no writer of its own (Hole-less configuration).Effective mask_influence — a bubbled writer's op is composed with the influence handed down the instance chain (
own && inherited). Amask_influence == 0instance drops the child's writers onto the union (counter) plane, so they no longer XOR-cancel against a co-existing outer mask.mask_write is not a target flag —
mask_writeno longer forces a clipping part to be a mask target. Target-ness is the composedmask_influencealone; amask_influence == 0clipping part is opted out (Rule_Mask.md§2-3/§3). Its own colour is only clipped by other masks, per its real influence.Only clipping writers carry out — a pure mask closes within the child. The replay shader (
ss_library_fs.glsl) already unions the parity/counter planes, so it is unchanged; the 24-bit coverage budget is respected.Scope
Verification
build-extension.ps1: builds clean.InstancePropagationmatches SS7.5 (owner-confirmed).