Fixed non-uniform scaling of normals
This commit is contained in:
parent
fb176d5f6e
commit
7e94c583e0
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue