From 5ae4b38e16aa0a32251f7015c05b04fb30025a3a Mon Sep 17 00:00:00 2001 From: Franchioping Date: Thu, 4 Dec 2025 17:32:53 +0000 Subject: [PATCH] bump up shadowtex resolution. change bias values. ideal for laptop for now --- src/rendering.rs | 2 +- src/shaders/shader.frag | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) 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++)