render3d: terrain_baked_at - a map's terrain and sun shadow taken from its bakes at start and on a swap

The game names the tiles' and the shadow's bake files (key, version) before the map is made; r3d_init's
terrain step and terrain_reload then open them with terrain_from_baked / terrain_shadow_from_bytes and
generate nothing, and fall back to the survey (saying so once) when a bake is missing or stale. Without
the call nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 17:42:16 +03:00
parent f02eab5c51
commit 06d828a296
5 changed files with 53 additions and 2 deletions

View file

@ -831,6 +831,11 @@ export state Render3dState {
ter_shadow_tex: int = 0 # height-field sun shadow: R32F, the lowest lit height
stream_capture_c: Chunk = null # the bake's capture chunk (stream_baked.ludic)
sb_rec: floats = floats(8) # one decoded baked record, reused (stream_baked.ludic)
tb_tiles: string = "" # the map's baked tiles and shadow (terrain_baked_boot.ludic)
tb_shadow: string = ""
tb_key: string = ""
tb_version: int = 0
tb_shadow_ok: bool = false # the shadow came from its bake this map
tt_dir: string = "" # terrain_tiles_to: where a map's tiles are written ("" keeps the whole copies)
tt_key: string = ""
tt_file: pointer = null # the tiles' file, open for reading (terrain_tiles.ludic)