feat(render3d): light you can see - sun shafts and valley mist
Everything before this made the air a COLOUR APPLIED TO A SURFACE. Nothing put light in the space between surfaces, so the basin had no shafts, no pooled mist and no rays off a ridge at any hour, whatever was done to the fog. A half-resolution march from the camera to the depth buffer, asking the same shadow the rest of the frame asks - the cascades, the baked height-field shadow and the cloud mask - so a shaft is cast by the actual trees and the actual ridge and a passing cloud dims its own rays. Henyey-Greenstein scattering, because real air throws light forward. Density and a separate ground-hugging mist layer ride the sun's elevation, so mist forms in the cold at either end of the day and burns off by mid-morning. Composited with the bloom pyramid's own tent upsample under ONE/ONE - what was wanted and already there - and before bloom, so a shaft blooms. Into post_hdr, not post_scene: post_scene is what the water refracts and shafts added there would sit under the lake. The tuning that mattered was the sky term, which is added at every step: at 0.06 it accumulated into a flat grey wash lifting lit and shadowed air equally, which is the contrast a shaft is made of, and the valley came out one pale sheet. At 0.012 the sun dominates and there is light rather than fog. I cut the density and mist three times before the frame looked like air instead of paint. R3D_NOVOL=1 for an A/B; Off in Settings skips the pass whole. 400 frames at 07:00: GL 7.1 -> 7.3 s, VK 7.2 -> 7.4 s. Backends agree to 0.08/255. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
d34fb5bc63
commit
b12228c662
15 changed files with 252 additions and 1 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
packages/ludic.render3d/shaders/spv/74258189.frag.spv
Normal file
BIN
packages/ludic.render3d/shaders/spv/74258189.frag.spv
Normal file
Binary file not shown.
BIN
packages/ludic.render3d/shaders/spv/74258189.vert.spv
Normal file
BIN
packages/ludic.render3d/shaders/spv/74258189.vert.spv
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -3117,3 +3117,54 @@ T 46e2325c u_scene 7
|
|||
T 46e2325c u_shadow 8
|
||||
T 46e2325c u_tershadow 9
|
||||
T 46e2325c u_ts_height 10
|
||||
P 74258189 fullscreen.vert volumetric.frag
|
||||
B 74258189 frag 1 924
|
||||
U 74258189 frag u_cascade_vp 0 mat4 5 64
|
||||
U 74258189 frag u_cascade_split 320 float 5 16
|
||||
U 74258189 frag u_cascade_range 400 float 5 16
|
||||
U 74258189 frag u_cascade_texel 480 float 5 16
|
||||
U 74258189 frag u_sun_dir 560 vec3 1 0
|
||||
U 74258189 frag u_sun_color 576 vec3 1 0
|
||||
U 74258189 frag u_cam_pos 592 vec3 1 0
|
||||
U 74258189 frag u_prefilter_levels 604 float 1 0
|
||||
U 74258189 frag u_fog_density 608 float 1 0
|
||||
U 74258189 frag u_fog_height_falloff 612 float 1 0
|
||||
U 74258189 frag u_fog_base 616 float 1 0
|
||||
U 74258189 frag u_clip_y 620 float 1 0
|
||||
U 74258189 frag u_spec_scale 624 float 1 0
|
||||
U 74258189 frag u_sky_rot 632 vec2 1 0
|
||||
U 74258189 frag u_ground_alb 640 vec3 1 0
|
||||
U 74258189 frag u_ground_alb_hi 656 vec3 1 0
|
||||
U 74258189 frag u_ground_hi_y 668 float 1 0
|
||||
U 74258189 frag u_ground_hi_w 672 float 1 0
|
||||
U 74258189 frag u_ibl_scale 688 vec3 1 0
|
||||
U 74258189 frag u_daylight 700 float 1 0
|
||||
U 74258189 frag u_fire_pos 704 vec3 1 0
|
||||
U 74258189 frag u_fire_color 720 vec3 1 0
|
||||
U 74258189 frag u_hand_pos 736 vec3 1 0
|
||||
U 74258189 frag u_hand_color 752 vec3 1 0
|
||||
U 74258189 frag u_hand_dir 768 vec3 1 0
|
||||
U 74258189 frag u_hand_cone 780 float 1 0
|
||||
U 74258189 frag u_ts_origin 784 vec2 1 0
|
||||
U 74258189 frag u_ts_half 792 float 1 0
|
||||
U 74258189 frag u_ts_on 796 float 1 0
|
||||
U 74258189 frag u_force_cascade 800 int 1 0
|
||||
U 74258189 frag u_cloud_shadow 804 float 1 0
|
||||
U 74258189 frag u_time 808 float 1 0
|
||||
U 74258189 frag u_fog_inscatter 812 float 1 0
|
||||
U 74258189 frag u_fog_desat 816 float 1 0
|
||||
U 74258189 frag u_inv_vp 832 mat4 1 0
|
||||
U 74258189 frag u_vol_steps 896 float 1 0
|
||||
U 74258189 frag u_vol_density 900 float 1 0
|
||||
U 74258189 frag u_vol_falloff 904 float 1 0
|
||||
U 74258189 frag u_vol_far 908 float 1 0
|
||||
U 74258189 frag u_vol_g 912 float 1 0
|
||||
U 74258189 frag u_vol_mist 916 float 1 0
|
||||
U 74258189 frag u_vol_mist_h 920 float 1 0
|
||||
T 74258189 u_brdf 2
|
||||
T 74258189 u_depth 3
|
||||
T 74258189 u_irradiance 4
|
||||
T 74258189 u_prefilter 5
|
||||
T 74258189 u_shadow 6
|
||||
T 74258189 u_tershadow 7
|
||||
T 74258189 u_ts_height 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue