diff options
author | kleonc <9283098+kleonc@users.noreply.github.com> | 2024-01-15 17:32:26 +0100 |
---|---|---|
committer | kleonc <9283098+kleonc@users.noreply.github.com> | 2024-01-15 17:34:29 +0100 |
commit | 0fe7eead024ef0b4ae2750aa09594beb8f4bb11c (patch) | |
tree | 11c3c39831d1f19fcea561f7fb8fa4162445e212 /drivers/gles3/shaders | |
parent | 26b1fd0d842fa3c2f090ead47e8ea7cd2d6515e1 (diff) | |
download | redot-engine-0fe7eead024ef0b4ae2750aa09594beb8f4bb11c.tar.gz |
Fix 2D normals for transposed texture
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/canvas.glsl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index ce8fe25625..c517fcb8ae 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -587,6 +587,9 @@ void main() { if (normal_used || (using_light && bool(read_draw_data_flags & FLAGS_DEFAULT_NORMAL_MAP_USED))) { normal.xy = texture(normal_texture, uv).xy * vec2(2.0, -2.0) - vec2(1.0, -1.0); + if (bool(read_draw_data_flags & FLAGS_TRANSPOSE_RECT)) { + normal.xy = normal.yx; + } if (bool(read_draw_data_flags & FLAGS_FLIP_H)) { normal.x = -normal.x; } |