render3d + lab: bakes as PNGs, and impostors, the sky's light and the carpet read from their bakes

ludic.lab: lab_png_write / lab_png_write_from (raw 8-bit, 1-4 channels, stored deflate) in png_write.ludic,
importable alone with its own LabPngState; png_convert.ludic's previews of float textures (R32F min..max,
RG16F x255, HDR x/(1+x) + sRGB); lab_ppm_to_png on the same encoder.
render3d: bake_load.ludic - impostor_from_baked / impostor_source / impostor_refill (a fog re-open reads
the bake), sky_baked_in and sky_precompute trying the bake at the start yaw (sky_compute is the
convolution, and sky_ibl_bytes always uses it), carpet_from_baked / carpet_bytes / carpet_finish,
bake_part_count / _len / _off. Compile-only: nothing run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-29 19:10:06 +03:00
parent f79390838a
commit 6c690c5db6
15 changed files with 396 additions and 107 deletions

View file

@ -1,5 +1,5 @@
# fog_impostors.ludic — a layer's impostor atlases are let go while the fog wall is nearer than its
# cards begin (the layer's `near`), and baked again when the fog opens past it. Inside the wall every
# cards begin (the layer's `near`), and baked again (or read again from its bake) when the fog opens past it. Inside the wall every
# instance is a mesh, and the meshes' LOD2 cast its shadows, so a card is neither drawn nor cast.
# does the wall let any of this layer's instances be drawn as a card?
@ -22,7 +22,8 @@ function fog_impostor(render3d_st: mut Render3dState, l: Layer) -> void {
let t0 = gl_now_us()
let was = render3d_st.gvk_tag
render3d_st.gvk_tag = VKM_IMPOSTOR
impostor_paint(render3d_st, im)
# a baked impostor is read again rather than drawn again (bake_load.ludic)
if not (im.src_ok and impostor_refill(render3d_st, im)) { impostor_paint(render3d_st, im) }
render3d_st.gvk_tag = was
render3d_st.fog_imp_rebake_us = render3d_st.fog_imp_rebake_us + (gl_now_us() - t0)
render3d_st.fog_imp_rebaked += 1