Clamp SpecularIBL value on positive range

This commit is contained in:
Vincent Lejeune 2014-12-09 01:33:58 +01:00
parent 25e059dd3e
commit d97b9f2d0e

@ -7,5 +7,5 @@ vec3 SpecularIBL(vec3 normal, vec3 V, float roughness)
// Assume 8 level of lod (ie 256x256 texture)
float lodval = 8. * (1. - roughness);
return textureLod(probe, sampleDirection, lodval).rgb;
return max(textureLod(probe, sampleDirection, lodval).rgb, vec3(0.));
}