Fixed lights and added a bad gamma correction

This commit is contained in:
Tleety
2014-05-10 19:51:48 +02:00
parent d00ff3c2ed
commit c1c30b0019
7 changed files with 81 additions and 80 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
#version 430
uniform vec3 La;
uniform float Gamma;
layout (binding=0) uniform sampler2D DiffuseTexture;
layout (binding=1) uniform sampler2D LightingTexture;
@@ -18,5 +19,6 @@ void main()
vec4 DiffuseTexel = texture(DiffuseTexture, Input.TextureCoord);
vec4 LightingTexel = texture(LightingTexture, Input.TextureCoord);
FragmentColor = DiffuseTexel * vec4(La, 1.0) + LightingTexel;
vec4 _FragmentColor = DiffuseTexel * vec4(La, 1.0) + LightingTexel;
FragmentColor = vec4(pow(_FragmentColor.rgb, vec3(1.0 / Gamma)), _FragmentColor.a);
}