Is it possible to explicitly access a mipmap level?

Matteo Marson's icon

Hey everyone,

I'm writing an image-based lighting (IBL) shader, and I'm using a roughness map to decide how much to blur the environment texture. For optimization's sake, I'm not blurring the texture every time, but I'm storing many progressively blurred texture layers inside a 3D texture.
This operation requires a lot of unnecessary memory since the blurred (low-passed) versions of the same texture can be represented with a smaller amount of pixels without any aliasing. Moreover, this limits the reasonable number of layers I can use. I'm basically replicating the concept of mipmapping but without reducing the dimension of the textures progressively.
So, I'm wondering if there's a way to explicitly access a specific mipmap layer inside a Jitter shader.
I know that you can sample a texture with the command

color = textureLod(textureName, coordinates, mipmapLevel);

to specify which layer to go fishing from, but I'm not sure if this works in a Jitter shader.
Thanks for your wise help!

Rob Ramirez's icon

I thought I had this working in gl3 engine (enabled via the mipmap attribute), but it doesn't appear to be working as expected. I'll have to investigate and sort it out in an update.

Matteo Marson's icon

Terrific! Thanks Rob!