I am new in BabylonJS, and trying to build some PBR materials with special effects, for example “thin film iridescence” in BabylonJS. I am learning something about PBR-Material and building my own PBR-Shader. I built a basic PBR-Shader, and now I want to do something more with IBL(image based lighting) and hdr. For Specular IBL i need to use textureLod Function from openGL to load mipmap according to the roughness levels. I tried something, but i always get the error “ERROR: 0:51: ‘textureLod’ : no matching overloaded function found”.
hier is what i tried.
in HTML file i added :
var engine = new BABYLON.Engine(canvas, false);
engine.getCaps().textureLOD = true;
In fragment shader i added
#extension GL_EXT_shader_texture_lod : enable
and in fragment shader i tried to use textureLod like this:
here is the link: https://www.babylonjs-playground.com/#A74XFM#3
It took me a little time to put everything in the playground, and i still could not put the dds file in the playground, which i want to textureLod.
It works!
I think “#extension GL_OES_standard_derivatives : enable” is what missed. With these two extension lines, i can use textureLod here. And what i actually want to try is this one "gvec4 textureLod ( gsampler3D sampler, vec3 P, float lod); ". Now the first step textureLod function works!!