summaryrefslogtreecommitdiff
path: root/src/3d
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 14:12:36 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 14:12:36 +0100
commit259d2b31035259be4f24b1bde2101dafcdafd242 (patch)
tree44870a9d419875a6d23b283d959d0355a77c3f59 /src/3d
parent9048115d66cb5ad18e37aad7d48cb6a708b3c3d5 (diff)
fix(3d): Fix shader syntax error and duplicate declaration
- Removed duplicate 'light_dir' declaration in the shader. - Fixed a syntax error (duplicate closing raw string delimiter) that caused shader compilation failure. - Verified all targets build and run correctly with 'check_all.sh'.
Diffstat (limited to 'src/3d')
-rw-r--r--src/3d/renderer.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/3d/renderer.cc b/src/3d/renderer.cc
index cc2124e..6de7fee 100644
--- a/src/3d/renderer.cc
+++ b/src/3d/renderer.cc
@@ -219,11 +219,10 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
let n_local = normalize(vec3<f32>(d_x1 - d_x2, d_y1 - d_y2, d_z1 - d_z2));
- let n_world = mat3 * n_local;
- let normal = normalize(n_world);
+ normal = normalize(mat3 * n_local);
+ }
let shadow = calc_shadow(p + normal * 0.01, light_dir, 0.0, 20.0);
-
let lighting = (max(dot(normal, light_dir), 0.0) * shadow) + 0.1;
return vec4<f32>(in.color.rgb * lighting, 1.0);
}