CheckBufferStatus gives me this:
[ERROR] Unsupported by FBO implementation.
I’m trying to implement shadow maps in a deferred engine and thus I need to render the depth for the light matrixes to this depth buffer.
Anyone has any idea as to why this doesn’t work?
I am absolutely positive that using GL_LINEAR_MIPMAP_LINEAR on GL_TEXTURE_MAG_FILTER breaks shadow map FBO’s on my development machines. Tested again to be sure. For this reason, I am using:
I am absolutely positive that using GL_LINEAR_MIPMAP_LINEAR on GL_TEXTURE_MAG_FILTER breaks shadow map FBO’s on my development machines.
Technically, it shouldn’t work at all. There are 2 accepted values for TEXTURE_MAG_FILTER: GL_LINEAR and GL_NEAREST. Mip-map filtering is what you do in minification settings, not magnification.
I modified that.
Now the error only was only shown when before this line
glGenerateMipmapEXT(GL_TEXTURE_2D);
after that the buffer is ok. I didn’t modify the matrixes at all just to test if the depth buffer works.
It does not. I have the depth from my regular buffer shown quite well and a bit lower the depth map only buffer which shows nothing (white).
I do draw the scene 2 times a frame(second time with no shader. Give the fact that the vert shader usually does nothing it should work the same).
To set my buffer I used this:
Why are you trying to generate mipmaps for a texture that has undefined data? Remember, you didn’t upload any data to that texture. You shouldn’t be calling glGenerateMipmap() unless you have actually put some data in the buffer.
And why are you trying to mipmap a depth buffer to begin with?
(second time with no shader. Give the fact that the vert shader usually does nothing it should work the same).
Did you ask for invariance between shader and non-shader in your vertex shader that “does nothing”? If not, then you aren’t guaranteed to get it.
When it comes to depth buffers, white isn’t necessarily bad (pardon my optimistic reasoning). Try rendering a polygon into the camera or something and see if the resulting depth buffer is still all white? This should give you really low values which will become black upon visualisation as they approach the near plane. Depth value precision isn’t a linear thing and often, the geometry being drawn is too far away from the camera to show as anything but white and your depth buffer will seem to “not work” when in fact it’s ok in itself.
glGenerateMipmap() is just used to allocate the mipmaps in this case. The same can be achieved with all the calls to glTexImage2D for each mipmap allocation.