summaryrefslogtreecommitdiff
path: root/src/3d/renderer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/3d/renderer.cc')
-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);
}