Make ambient light header GLES safe

This commit is contained in:
Brad Davis 2018-01-28 14:40:25 -08:00
parent 29d6813963
commit 7565e08657

View file

@ -16,9 +16,13 @@ uniform samplerCube skyboxMap;
vec4 evalSkyboxLight(vec3 direction, float lod) {
// textureQueryLevels is not available until #430, so we require explicit lod
// float mipmapLevel = lod * textureQueryLevels(skyboxMap);
#if !defined(GL_ES)
float filterLod = textureQueryLod(skyboxMap, direction).x;
// Keep texture filtering LOD as limit to prevent aliasing on specular reflection
lod = max(lod, filterLod);
#endif
return textureLod(skyboxMap, direction, lod);
}
<@endfunc@>