Add a near shadow map for moving casters #81

Closed
opened 2026-10-20 08:49:27 +00:00 by sermuns · 1 comment
Owner

There is one shadow map: an ortho box fitted to every building, 4096 wide,
rebuilt only when the sun moves. Cascades are in the Dropped list, and the
reasoning is sound -- the box is the same wherever the player stands, so it can
be built once.

Two things it cannot do:

  • Resolve detail. Across roughly a kilometre and a half of campus, 4096 texels is
    about half a metre each. Doorways, roof edges, wall bases and tree trunks are
    smaller than the shadow they should cast.
  • Include anything that moves. Bodies receive but never cast, and a third-person
    avatar with no shadow reads as a cut-out. Vehicles are in the same position.

The proposal is a second, player-following map over a few hundred metres, drawn
every frame for bodies, vehicles and props, sampled by the same shadow_term and
blended over the static map near its edge. The campus-wide map stays as the far
tier and stays static.

This reverses a documented decision, and it is the one idea here with a real
per-frame cost, so it needs a clamp or an opt-out on WebGL2 before it is enabled
by default.

Related: #80 gets the static half for free. #39 and #64 add light
sources that will make bodies and windows read as casters too.

There is one shadow map: an ortho box fitted to every building, 4096 wide, rebuilt only when the sun moves. Cascades are in the Dropped list, and the reasoning is sound -- the box is the same wherever the player stands, so it can be built once. Two things it cannot do: - Resolve detail. Across roughly a kilometre and a half of campus, 4096 texels is about half a metre each. Doorways, roof edges, wall bases and tree trunks are smaller than the shadow they should cast. - Include anything that moves. Bodies receive but never cast, and a third-person avatar with no shadow reads as a cut-out. Vehicles are in the same position. The proposal is a second, player-following map over a few hundred metres, drawn every frame for bodies, vehicles and props, sampled by the same `shadow_term` and blended over the static map near its edge. The campus-wide map stays as the far tier and stays static. This reverses a documented decision, and it is the one idea here with a real per-frame cost, so it needs a clamp or an opt-out on WebGL2 before it is enabled by default. Related: #80 gets the static half for free. #39 and #64 add light sources that will make bodies and windows read as casters too.
sermuns added this to the Rendering milestone 2026-10-20 08:49:27 +00:00
Author
Owner

Closing as out of scope. A near shadow map reverses the documented static-shadow decision and is the one idea here with a real per-frame cost; it would need a clamp or opt-out on WebGL2 before it could be on by default. Cascaded and near shadows stay on the dropped list.

Closing as out of scope. A near shadow map reverses the documented static-shadow decision and is the one idea here with a real per-frame cost; it would need a clamp or opt-out on WebGL2 before it could be on by default. Cascaded and near shadows stay on the dropped list.
Sign in to join this conversation.
No description provided.