0
votes

I'm writing texture atlas on the fragment shader and I really need to use texture2DLod in order to render the textures correctly in different mip levels. I just found out that WebGL only supports texture2DLod on the vertex shader. Is there some way for me to access texture2DLod on the fragment shader? Perhaps I could use a custom function that does the same?

1

1 Answers

4
votes

Simply use texture2D with the third parameter set to the lod you want to use:

gl_FragColor = texture2D(map, uv, lod)