@@ -27,38 +27,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2727#include "light_cluster.hlsl"
2828//============================
2929
30- // Cloud shadow map sampling
31- // tex3 is bound as the cloud shadow map in Pass_Light
32- float sample_cloud_shadow (float3 world_pos)
33- {
34- // skip if cloud shadows are disabled
35- if (buffer_frame.cloud_shadows <= 0.0 || buffer_frame.cloud_coverage <= 0.0 )
36- return 1.0 ;
37-
38- // cloud shadow map covers 10km x 10km area
39- float shadow_map_size = 10000.0 ;
40-
41- // get shadow map dimensions for texel size calculation
42- float2 shadow_dims;
43- tex3.GetDimensions (shadow_dims.x, shadow_dims.y);
44- float texel_size = shadow_map_size / shadow_dims.x;
45-
46- // snap center to texel grid (must match cloud_shadow.hlsl)
47- float2 snapped_center = floor (buffer_frame.camera_position.xz / texel_size) * texel_size;
48-
49- float2 relative_pos = world_pos.xz - snapped_center;
50- float2 uv = relative_pos / shadow_map_size + 0.5 ;
51-
52- // out of bounds check
53- if (any (uv < 0.0 ) || any (uv > 1.0 ))
54- return 1.0 ;
55-
56- // sample cloud shadow (tex3 is the cloud shadow map)
57- float shadow = tex3.SampleLevel (GET_SAMPLER (sampler_bilinear_clamp), uv, 0 ).r;
58-
59- return shadow;
60- }
61-
6230// ray traced shadow sampling
6331// tex4 is bound as the ray traced shadow texture in Pass_Light
6432float sample_ray_traced_shadow (float2 uv)
@@ -367,14 +335,6 @@ void evaluate_light(
367335 light.radiance *= L_shadow;
368336 }
369337
370- // cloud shadows apply to directional lights regardless of shadow method
371- if (light.is_directional ())
372- {
373- float cloud_shadow = sample_cloud_shadow (surface.position);
374- L_shadow = min (L_shadow, cloud_shadow);
375- light.radiance *= cloud_shadow;
376- }
377-
378338 AngularInfo angular_info;
379339 angular_info.Build (light, surface);
380340
0 commit comments