mirror of
https://github.com/godotengine/godot.git
synced 2025-04-13 01:00:35 +08:00
Fixed non-uniform scaling of normals
This commit is contained in:
parent
fb176d5f6e
commit
7e94c583e0
@ -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…
x
Reference in New Issue
Block a user