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:
parent
f79390838a
commit
6c690c5db6
15 changed files with 396 additions and 107 deletions
|
|
@ -6,6 +6,7 @@
|
|||
# ============================================================================
|
||||
|
||||
const SKY_PREFILTER_LEVELS: int = 6
|
||||
const SKY_DEFAULT_HDRI: string = "kloofendal_48d_partly_cloudy_puresky_4k" # under <assets>/hdri/, when no path is given
|
||||
|
||||
# The yaw to bake the light at the first time (radians, float bits). A game that turns the sky at
|
||||
# start sets it before r3d_init, so the image-based light is baked once at that yaw rather than at
|
||||
|
|
@ -90,7 +91,13 @@ function sky_set_quality(render3d_st: mut Render3dState, w: int) -> void {
|
|||
if render3d_st.sky_irradiance != 0 { sky_precompute(render3d_st) }
|
||||
}
|
||||
|
||||
# the IBL set for the sky as it is turned now: from its bake where there is a current one (bake_load.ludic)
|
||||
function sky_precompute(render3d_st: mut Render3dState) -> void {
|
||||
if sky_ibl_try_baked(render3d_st) { return }
|
||||
sky_compute(render3d_st)
|
||||
}
|
||||
# the IBL set convolved from the HDRI on the GPU
|
||||
function sky_compute(render3d_st: mut Render3dState) -> void {
|
||||
gpu_depth_test(render3d_st, false)
|
||||
sky_ibl_make(render3d_st)
|
||||
if render3d_st.sky_p_irr == 0 { render3d_st.sky_p_irr = r3d_program(render3d_st, "fullscreen.vert", "ibl_irradiance.frag", ""); render3d_st.sky_p_pre = r3d_program(render3d_st, "fullscreen.vert", "ibl_prefilter.frag", ""); render3d_st.sky_p_brdf = r3d_program(render3d_st, "fullscreen.vert", "ibl_brdf.frag", "") }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue