diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-02 01:52:56 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-02 01:52:56 -0400 |
commit | 062a7e2baad74f49f2548793a25f0cf5e4ae6f86 (patch) | |
tree | 151ad921a5982b83a16b8049d77f9af6cc76573b /Shaders | |
parent | b52920a35eb69d1a258c737e3114fbe5cfe9aca5 (diff) |
Fixed flipped texture normals being displayed properly in shaders
Diffstat (limited to 'Shaders')
-rw-r--r-- | Shaders/world.frag | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Shaders/world.frag b/Shaders/world.frag index 85941f2..881127b 100644 --- a/Shaders/world.frag +++ b/Shaders/world.frag @@ -17,6 +17,7 @@ uniform vec3 LightPos[32]; uniform vec4 LightColor[32]; uniform int LightNum; uniform vec4 AmbientLight; +uniform int Flipped; void main() { @@ -33,6 +34,8 @@ void main() for (int i = 0; i < LightNum; i++) { vec3 LightDir = vec3(LightPos[i].xy - fragCoord.xy, LightPos[i].z); + if (Flipped == 1) + LightDir.x = -LightDir.x; float D = length(LightDir); |