render3d: the fog wall culls on the CPU - nothing past it costs a draw, a vertex or a caster
cam_sphere_visible refuses a sphere wholly past the wall (terrain patches, scatter cells, stream
chunks, grass tiles, water), actors past it are skipped for draws, casters and outlines, the grass
reach and the streams' generate-and-gather reach end at it, and the card shadows cast only from
the wall's share of a layer (fog_casters.ludic, rebuilt every 4 m). r3d_beyond_fog is exported for
the game to skip animating what will not be drawn. Render-only: no query of the ground or the world
changes, and off is the old frame (0 pixels over 8 against 160ce96, twice per side).
Draws per frame at the overlook: 2757 off, 1104 at 175 m, 484 at 30 m.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b9f9cb8495
commit
2ce2d997be
9 changed files with 88 additions and 11 deletions
|
|
@ -175,6 +175,10 @@ function ac_visible(render3d_st: Render3dState, a: Actor, shadow: bool) -> bool
|
|||
if a.model == null { return false }
|
||||
if not a.visible and not (shadow and a.cast_hidden) { return false }
|
||||
if shadow and not a.casts { return false }
|
||||
# an actor with no radius given is sized generously, since a building or the dock may be one
|
||||
var fr = a.radius * a.scale
|
||||
if fr <= 0.0 { fr = 20.0 }
|
||||
if r3d_beyond_fog(render3d_st, a.x, a.y, a.z, fr) { return false }
|
||||
if a.cull != 0.0 {
|
||||
let dx = a.x - render3d_st.cam_pos[0]; let dz = a.z - render3d_st.cam_pos[2]
|
||||
let d2 = dx * dx + dz * dz
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue