summaryrefslogtreecommitdiff
path: root/assets/final/shaders/mesh_render.wgsl
diff options
context:
space:
mode:
Diffstat (limited to 'assets/final/shaders/mesh_render.wgsl')
-rw-r--r--assets/final/shaders/mesh_render.wgsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/assets/final/shaders/mesh_render.wgsl b/assets/final/shaders/mesh_render.wgsl
index 3faf7ca..068efbc 100644
--- a/assets/final/shaders/mesh_render.wgsl
+++ b/assets/final/shaders/mesh_render.wgsl
@@ -34,8 +34,9 @@ fn vs_main(in: VertexInput, @builtin(instance_index) instance_index: u32) -> Ver
out.world_pos = world_pos.xyz;
// Use transpose of inverse for normals
+ // Note: mat3x3 constructor takes columns, so passing rows gives us transpose
let normal_matrix = mat3x3<f32>(obj.inv_model[0].xyz, obj.inv_model[1].xyz, obj.inv_model[2].xyz);
- out.normal = normalize(transpose(normal_matrix) * in.normal);
+ out.normal = normalize(normal_matrix * in.normal);
out.uv = in.uv;
out.color = obj.color;