Skip to main content

compute_terrain_shadow_map

Function compute_terrain_shadow_map 

Source
pub fn compute_terrain_shadow_map(
    hmap: &Heightmap,
    sun_dir: Vec3,
    cell_size: f32,
    height_scale: f32,
) -> Vec<f32>
Expand description

Compute shadow intensity for each heightmap cell from a directional light Returns 0 = fully shadowed, 1 = fully lit