stk-code_catmod/data/shaders/utils/SpecularIBL.frag
Vincent Lejeune d50dde4c97 Revert "Try to fix ibl precision issue"
This reverts commit 1cf592394b.
2014-12-14 02:48:47 +01:00

12 lines
380 B
GLSL

uniform samplerCube probe;
vec3 SpecularIBL(vec3 normal, vec3 V, float roughness)
{
vec3 sampleDirection = reflect(-V, normal);
sampleDirection = (InverseViewMatrix * vec4(sampleDirection, 0.)).xyz;
// Assume 8 level of lod (ie 256x256 texture)
float lodval = 8. * (1. - roughness);
return clamp( textureLod(probe, sampleDirection, lodval).rgb, 0., 1.);
}