Skip to content

fix(player): carry instance-internal masks out to the parent's later parts - #295

Merged
MasamiYitsuse merged 1 commit into
developfrom
feature/instance_propergation
Aug 27, 2026
Merged

fix(player): carry instance-internal masks out to the parent's later parts#295
MasamiYitsuse merged 1 commit into
developfrom
feature/instance_propergation

Conversation

@MasamiYitsuse

Copy link
Copy Markdown
Collaborator

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 against tests/overall/InstancePropagation.

The three fixes

  1. Carry-over (main) — an instance child's clipping writers (write_mask normal 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_coverage now 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).

  2. Effective mask_influence — a bubbled writer's op is composed with the influence handed down the instance chain (own && inherited). A mask_influence == 0 instance drops the child's writers onto the union (counter) plane, so they no longer XOR-cancel against a co-existing outer mask.

  3. mask_write is not a target flagmask_write no longer forces a clipping part to be a mask target. Target-ness is the composed mask_influence alone; a mask_influence == 0 clipping 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

  • Single-stage, matching the existing downlink inheritance (a nested grandchild's internal mask does not bubble past one level).
  • Within-child masking (a sub-animation clipping its own later parts) is out of scope here — the visible bug is the parent's later parts.

Verification

  • build-extension.ps1: builds clean.
  • Visual: InstancePropagation matches SS7.5 (owner-confirmed).

…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).
@MasamiYitsuse
MasamiYitsuse merged commit ddd8b2c into develop Aug 27, 2026
0 of 2 checks passed
@MasamiYitsuse
MasamiYitsuse deleted the feature/instance_propergation branch August 27, 2026 16:18
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