diff options
author | K. S. Ernest (iFire) Lee <fire@users.noreply.github.com> | 2021-08-22 14:49:10 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-22 14:49:10 -0700 |
commit | fe1d5515439a2138fa54272e735b925aa7e938fc (patch) | |
tree | b4060064a0c1b57c89b55670fac628dc2120ff96 /servers/rendering/renderer_rd | |
parent | e63f7dcf03bc451876ef756ff6c67ebc107110b8 (diff) | |
parent | 7e94c583e0f7738488428c1205662baadfa08506 (diff) |
Merge pull request #51989 from drcd1/non-uniform-scale-fix
Fixes non-uniform scaling of normals
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl index adf9f20618..1288cee8b0 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl @@ -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); } diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl index a2a54a0511..39890d25ff 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_mobile.glsl @@ -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); } |