render3d: ground layers placed from painted densities - the density tiles (LGD1), their reader and the fill
ground_density_bake(path, key, version, hash, pngs) cuts each layer's PNG (R the chance a cell keeps one, G an optional scale) into the terrain's 64 m tiles, one layer decoded and let go at a time, as a bake's file; ground_density_open(...) reads it - or, when it is missing or stale, a dev build's own copy cut from the PNGs - a tile at a time into a 256-tile clock, never a layer whole. ground_fill(s, cx, cz, band, g) places a GroundFill row's instances in a stream chunk: a candidate per cell of the band's step, jittered, kept when a hash of (layer, chunk, band, cell) falls under the density (times the game's trample, r3d_on_ground_trample, where the row asks); scale, yaw, seed and wind from the same hash. Nothing calls it yet: behaviour unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f79390838a
commit
c672be101e
5 changed files with 282 additions and 0 deletions
|
|
@ -837,6 +837,18 @@ export state Render3dState {
|
|||
tb_version: int = 0
|
||||
tb_shadow_ok: bool = false # the shadow came from its bake this map
|
||||
gltf_pure: int = 0 # a 1x1 white a factor multiplies exactly (gltf_factors)
|
||||
gd_file: pointer = null # the map's ground densities (ground_density.ludic)
|
||||
gd_base: int = 0
|
||||
gd_n: int = 0
|
||||
gd_layers: int = 0
|
||||
gd_ch: words = null
|
||||
gd_off: words = null
|
||||
gd_pool: []byte = null
|
||||
gd_key: words = null
|
||||
gd_ref: words = null
|
||||
gd_slot_of: words = null
|
||||
gd_hand: int = 0
|
||||
gd_trample_cb: fn(float, float) -> float = null
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue