When there are 8 lod level, 7 is the max

This commit is contained in:
Vincent Lejeune 2015-01-15 19:52:48 +01:00
parent 86b2d2f327
commit 70e8b4c854

View File

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