MirrorModifier¶
MirrorModifier is a coordinate modifier that folds one or more axes of the layer buffer, halving the buffer size on each mirrored axis and reflecting the second half of the effect output into it.
Purpose¶
Without a modifier the EffectsLayer buffer is the full region size. With mirrorX = true the buffer is half as wide: the effect only needs to fill the left half, and the right half is the physical mirror. This halves memory and effect CPU cost while doubling visual symmetry.
Controls¶
| Key | UI type | Min | Max | Default | Description |
|---|---|---|---|---|---|
mirrorX |
toggle | — | — | false | Fold the X axis |
mirrorY |
toggle | — | — | false | Fold the Y axis |
mirrorZ |
toggle | — | — | false | Fold the Z axis |
enabled |
toggle | — | — | true | When false the modifier is bypassed |
Each enabled axis halves the buffer size on that dimension and maps the second half to the first via dim - 1 - coord.
Wiring¶
Add as a child of an EffectsLayer:
{ "type": "MirrorModifier", "id": "mirror1", "parent_id": "effects1" }
Behaviour¶
- Static (
isStatic() == true): the transform is a pure index remapping with no per-frame state.DriverLayerbakes the full physical-to-layer index table at setup. - Enabling or disabling the modifier at runtime triggers a map rebuild on the next
DriverLayer::loop(). - Composable: multiple
MirrorModifierinstances can be chained; each halves its axis independently.
Test coverage¶
See Modifiers — dim halving per axis, baked vs per-pixel equivalence, runtime control change triggering map rebuild, enable/disable rebuild.