Skip to content

Commit 5a3e777

Browse files
committed
Fix skinned mesh normal handling in mesh shader (#5095)
# Objective Update pbr mesh shader to use correct normals for skinned meshes. ## Solution Only use `mesh_normal_local_to_world` for normals if `SKINNED` is not defined.
1 parent ad88bda commit 5a3e777

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/bevy_pbr/src/render/mesh.wgsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ fn vertex(vertex: Vertex) -> VertexOutput {
4141
out.world_normal = skin_normals(model, vertex.normal);
4242
#else
4343
var model = mesh.model;
44+
out.world_normal = mesh_normal_local_to_world(vertex.normal);
4445
#endif
4546
out.world_position = mesh_position_local_to_world(model, vec4<f32>(vertex.position, 1.0));
46-
out.world_normal = mesh_normal_local_to_world(vertex.normal);
4747
out.uv = vertex.uv;
4848
#ifdef VERTEX_TANGENTS
4949
out.world_tangent = mesh_tangent_local_to_world(model, vertex.tangent);

0 commit comments

Comments
 (0)