Merge pull request #16149 from samcake/yellow

BUGZ-1360: Avoid bad normal values leading to black pixels in Forward
This commit is contained in:
Sam Gateau 2019-09-06 13:33:19 -07:00 committed by GitHub
commit f909bc4cde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -111,7 +111,7 @@ vec3 fetchNormalMap(vec2 uv) {
// unpack normal, swizzle to get into hifi tangent space with Y axis pointing out
vec2 t = 2.0 * (texture(normalMap, uv, TAA_TEXTURE_LOD_BIAS).rg - vec2(0.5, 0.5));
vec2 t2 = t*t;
return vec3(t.x, sqrt(1.0 - t2.x - t2.y), t.y);
return vec3(t.x, sqrt(max(0.0, 1.0 - t2.x - t2.y)), t.y);
}
<@endif@>