Add shadowCascadeMask to the render component - #9195
Conversation
Exposes MeshInstance#shadowCascadeMask on the render component, so selecting which directional shadow cascades an entity casts into no longer requires walking its mesh instances from a script.
Public API reportThis PR changes the public API surface (+2 / −0), per the docs' rules (@ignore / @Private / undocumented are excluded). Show API diff+RenderComponent.get shadowCascadeMask(): number
+RenderComponent.set shadowCascadeMask(value: number)Informational only — this never fails the build. |
Build size reportThis PR changes the size of the minified bundles.
|
mvaligursky
left a comment
There was a problem hiding this comment.
Automated PR review by Codex (GPT-5).
No actionable issues found.
Reviewed the change from the merge base for correctness, public API compatibility, component initialization and clone ordering, primitive and asset-driven mesh replacement, directional-shadow semantics, batching interactions, performance, documentation, and test coverage. The component-level value is retained independently of the current mesh instances and is consistently propagated through the shared meshInstances setter, so later primitive recreation and render-asset mesh updates inherit it. Adding the property to the ordered system property list also covers initialization and cloning without changing existing defaults.
Local verification on the exact head commit: the focused RenderComponent test suite passed (8 tests), ESLint passed for all changed files, generated TypeScript declarations include the new getter/setter, test:types passed, and git diff --check passed. All current GitHub checks are green.
Exposes the per-mesh directional shadow cascade mask on the render component, so selecting which cascades an entity casts into no longer requires walking its mesh instances from a script. Fixes #9126.
Changes:
RenderComponent#shadowCascadeMaskis assigned to every mesh instance the component manages, including ones created later by an asset load or atypechange.addComponentdata and preserved when an entity is cloned.API Changes:
RenderComponent#shadowCascadeMask, defaulting toSHADOW_CASCADE_ALL. CombineSHADOW_CASCADE_0..SHADOW_CASCADE_3to select individual cascades, and note that this only filters the meshes per cascade - usecastShadowsto disable shadow casting completely.ModelComponentis deliberately left alone as it is legacy, and the gsplat component cannot support this in unified mode, where shadow casters are registered per placement and rendered through a single shared mesh instance.