diff --git a/src/rendering.rs b/src/rendering.rs index 56addf6..53a573b 100644 --- a/src/rendering.rs +++ b/src/rendering.rs @@ -10,7 +10,7 @@ use rapier3d::prelude::*; use strum::IntoEnumIterator; mod ui; -const DEPTH_MAP_SIZE: u32 = 512; +const DEPTH_MAP_SIZE: u32 = 1024; const LIGHT_PROJECTION_SIZE: f32 = 40.0; const LIGHT_NEAR: f32 = 50.0; diff --git a/src/shaders/shader.frag b/src/shaders/shader.frag index 1b4ebe9..2297094 100644 --- a/src/shaders/shader.frag +++ b/src/shaders/shader.frag @@ -46,7 +46,12 @@ float calculate_shadow() { vec2 texelSize = 1.0 / textureSize(shadow_map, 0); - float shadow = 0; + float proj_depth = texture(shadow_map, proj_coords.xy).r; + // int show_shadow = current_depth - bias > proj_depth ? 0 : 1; + // if (show_shadow == 1) { + // return 1.0; + // } + float shadow = 0.0; int range = (shadow_step_count - 1) / 2; for (int x = -range; x <= range; x++)