From 5354b5dc0b67f775fe173f2968f2e01023e45e21 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 2 Feb 2026 16:39:15 +0100 Subject: fix(3d): Unify all objects to SDF path for consistent shadows - Updated ObjectData to include inv_model for reliable world-to-local mapping. - Enabled SDF raymarching path for all objects in test_3d_render (floor is now a large SDF BOX). - Implemented robust normal calculation using SDF gradient for all objects. - Standardized lighting (light_dir = 1,1,1) and diffuse+ambient model. - Refined calc_shadow with instance-based skip_idx and robust bias. - Fixed non-uniform scale handling in shader by extracting min scale from model matrix. --- src/3d/renderer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/3d/renderer.h') diff --git a/src/3d/renderer.h b/src/3d/renderer.h index a7f29da..c6ca2a3 100644 --- a/src/3d/renderer.h +++ b/src/3d/renderer.h @@ -23,7 +23,7 @@ struct GlobalUniforms { // Matches the GPU struct layout struct ObjectData { mat4 model; - mat4 model_inverse_transpose; + mat4 inv_model; vec4 color; vec4 params; // Type, etc. }; -- cgit v1.2.3