Merge pull request #51989 from drcd1/non-uniform-scale-fix
Fixes non-uniform scaling of normals
This commit is contained in:
@@ -118,7 +118,7 @@ void main() {
|
||||
|
||||
mat3 world_normal_matrix;
|
||||
if (bool(instances.data[instance_index].flags & INSTANCE_FLAGS_NON_UNIFORM_SCALE)) {
|
||||
world_normal_matrix = inverse(mat3(world_matrix));
|
||||
world_normal_matrix = transpose(inverse(mat3(world_matrix)));
|
||||
} else {
|
||||
world_normal_matrix = mat3(world_matrix);
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ void main() {
|
||||
|
||||
mat3 world_normal_matrix;
|
||||
if (bool(draw_call.flags & INSTANCE_FLAGS_NON_UNIFORM_SCALE)) {
|
||||
world_normal_matrix = inverse(mat3(world_matrix));
|
||||
world_normal_matrix = transpose(inverse(mat3(world_matrix)));
|
||||
} else {
|
||||
world_normal_matrix = mat3(world_matrix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user