Jump to content

using textureLod in ShaderMaterial


Sonja
 Share

Recommended Posts

hi guys,

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:

vec3 prefilteredColor = texture2DLodEXT(equirectangularMap, R,  roughness * MAX_REFLECTION_LOD);

then i got the error..."ERROR: 0:51: 'textureLod' : no matching overloaded function found"

I found some examples about textureLod and BabylonJS in playground, but non of them works.

Do you have any idea about this topic?

 

thanks,

Sonja

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...