summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-06 09:57:14 +0100
committerskal <pascal.massimino@gmail.com>2026-02-06 09:57:14 +0100
commite19e342ddb018dca3fffe32dc93c66e5a7dae519 (patch)
treee68e7d33fedc6794f86fa351e10edefbd30c7af9
parent2b4ce2eed8fc4333b2c623836e7969b66b7be6e4 (diff)
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.
-rw-r--r--src/tests/test_mesh.cc5
1 files 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);