Log inGet started
What it does

shadowSystem

Cascaded shadow map (CSM) policy for crisp directional shadows across a large view distance. The rendering mechanism lives in the engine; this package is the per-frame policy that drives it.

Layout

  • shadowSystem.module — the policy: PSSM frustum splitting, per-cascade bounding-sphere fit + texel-snap stabilization, and the matrix math. Pushes per-cascade light-space matrices + split distances to the renderer via __rendering.setShadowCascades each frame.
  • ShadowCascadeDriver.component — attach ONE to a scene entity to drive the module every frame from the active camera + sun.
  • depthBounds.renderFeature — reduces the frame's depth target to the nearest and farthest view depth any surface occupies, and hands the result to the module.

Flow

  1. Add a ShadowCascadeDriver component to any entity in the scene.
  2. Each frame it slices the camera frustum into N cascades (N from render.shadow_cascades), fits a stable light-space ortho to each, and pushes the matrices + split distances to the renderer.
  3. The renderer renders one shadow depth pass per cascade; the fragment shaders pick a cascade by the fragment's distance from the camera.

Fitting splits to the depth that is there

Splits are placed over a range. Taken from the camera's near and far planes that range is whatever the scene could occupy; taken from the depth buffer it is what the scene does occupy. A courtyard that stops at 40 m under a 200 m shadow distance spends most of its cascade texels on empty space.

entity.find("scene").component.add("ShadowCascadeDriver", {
    fitToDepth = true,   -- place splits over the measured depth
    depthMargin = 0.1,   -- room past the far end for a frame of movement
})

The far end is what moves. The near end stays where the camera puts it: the renderer picks a cascade from a fragment's distance and cascade 0 is fitted to the range's start, so raising that start would leave anything nearer sampling a box it does not sit inside.

The measurement is one frame old, because a GPU read-back cannot land in the frame that produced it. depthMargin is the room that gives something to move away in before it falls outside the last cascade.

With fitToDepth off, no reduction is dispatched and splits are placed exactly as before.

Purely additive: with no driver the renderer falls back to its legacy single camera-fit directional shadow. Quality is controlled by the render.shadow_resolution / render.shadow_cascades / render.shadow_distance / render.shadow_split_lambda world settings. render.shadow_distance is a cap on the range the splits run over, and its default of 0 leaves that range to the frame — the depth its own renderables reach.

Documentation

See shadowSystem.module/README.md and ShadowCascadeDriver.component/README.md.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

This asset doesn't declare a schema or structured payload.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

0items
This part has no composite children. See the Files segment for its leaf payloads.
This part has no leaf payloads.

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.