diff options
| author | skal <pascal.massimino@gmail.com> | 2026-02-02 14:12:36 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-02-02 14:12:36 +0100 |
| commit | 259d2b31035259be4f24b1bde2101dafcdafd242 (patch) | |
| tree | 44870a9d419875a6d23b283d959d0355a77c3f59 /src/3d | |
| parent | 9048115d66cb5ad18e37aad7d48cb6a708b3c3d5 (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.cc | 5 |
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); } |
