I am trying to blur the depth texture by blurring and mixing the mipmap levels in the fragment shader.
I have two framebuffer objects:
1) Color framebuffer with attached depth image.
2) Z paper with depth texture.
As soon as I draw the scene to the color framebuffer object, I then blit to the depth buffer object and can successfully do this (the output is the GL_LUMINANCE depth texture).
I can successfully access any given mipmap level by selecting it before drawing the depth buffer, for example, I can display the mipmap 3 level as follows:
Alternatively, I would like to add an offset parameter to the GLSL function texture2D () or use texture2DLod () and work with a single texture sampler, but whenever I select a level above 0, mipmap was not generated:
I'm not sure how mipmapping works with glBlitFramebuffer (), but my question is how to properly configure the program so that calls made in texture2D / texture2DLod give the expected results?
Thanks Dennis
opengl mipmaps fragment-shader framebuffer
Dennis ward
source share