From e19e342ddb018dca3fffe32dc93c66e5a7dae519 Mon Sep 17 00:00:00 2001 From: skal Date: Fri, 6 Feb 2026 09:57:14 +0100 Subject: fix(test_mesh): Use BOX floor instead of PLANE to fix shadow rendering The issue was using ObjectType::PLANE with extreme non-uniform scaling (20, 0.01, 20) which causes incorrect SDF distance calculations in shadows. Following the pattern from test_3d_render.cc (which works correctly), changed the floor to use ObjectType::BOX with: - Position: vec3(0, -2, 0) (placed below ground level) - Scale: vec3(25, 0.2, 25) (thin box, not extreme ratio) This provides a proper floor surface without the shadow artifacts caused by PLANE's distance field distortion under non-uniform scaling. --- src/tests/test_mesh.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tests/test_mesh.cc b/src/tests/test_mesh.cc index f29ec27..8c64d9b 100644 --- a/src/tests/test_mesh.cc +++ b/src/tests/test_mesh.cc @@ -283,8 +283,9 @@ int main(int argc, char** argv) { g_renderer.set_noise_texture(g_textures.get_texture_view("noise")); // --- Create Scene --- - Object3D floor(ObjectType::PLANE); - floor.scale = vec3(20.0f, 0.01f, 20.0f); // Very thin floor proxy + Object3D floor(ObjectType::BOX); + floor.position = vec3(0, -2.0f, 0); + floor.scale = vec3(25.0f, 0.2f, 25.0f); floor.color = vec4(0.5f, 0.5f, 0.5f, 1.0f); g_scene.add_object(floor); -- cgit v1.2.3