Fix normal map and srgb

This commit is contained in:
vlj 2014-04-07 01:03:14 +02:00
parent dd51124680
commit ca2b5a7237

View File

@ -19,7 +19,7 @@ vec2 EncodeNormal(vec3 n);
void main()
{
// normal in Tangent Space
vec3 TS_normal = 2.0 * texture (normalMap, uv).rgb - 1.0;
vec3 TS_normal = 2.0 * pow(texture(normalMap, uv).rgb, vec3(1./2.2)) - 1.0;
// Because of interpolation, we need to renormalize
vec3 Frag_tangent = normalize(tangent);
vec3 Frag_normal = normalize(cross(Frag_tangent, bitangent));