trying to workaround gamma correction (remove from tga)

This commit is contained in:
Anakin 2017-01-19 20:15:00 +01:00
parent 9fb3ca03bd
commit 28d17b2fdd

View File

@ -32,6 +32,7 @@ void main()
// some values
vec3 normalWorld = normalize(n_matrix * v_surfaceNormal);
vec4 surfaceColor = vec4(texture2D(texture, v_surfaceUV));
surfaceColor.rgb = pow(surfaceColor.rgb, vec3(2.2));
if(!b_transparent)
surfaceColor.a = 1.0f;
vec3 surfaceToLight = normalize(light.position - v_surfacePosition);
@ -60,6 +61,7 @@ void main()
// final color after gama correction
vec3 gamma = vec3(1.0/2.2);
gl_FragColor = vec4(pow(linearColor, gamma), surfaceColor.a);
//gl_FragColor = vec4(linearColor, surfaceColor.a);
}
else
{