Hi,
I’ve been working on some transparent postprocessing to my deferred render engine. However blitting the framebuffer gives me a headeache.
My FBO Depth/Stencil buffer setup looks line this:
// depth/stencil
glBindTexture(GL_TEXTURE_2D, ids[depthbuffer]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, scrdim[0], scrdim[1], 0,
GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_NONE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
GL_TEXTURE_2D, ids[depthbuffer], 0);
After the deferred process I need to blit the framebuffer from the FBO to the “screen buffer” in order to do the transparent pass in forward render mode.
glBindFramebuffer(GL_READ_FRAMEBUFFER, ids[fbocontainer]);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBlitFramebuffer(0, 0, scrdim[0], scrdim[1], 0, 0,
scrdim[0], scrdim[1],
GL_DEPTH_BUFFER_BIT,
GL_NEAREST);
This however generates an GL_INVALID_OPERATION on my NVIDIA card (WIN64). With the Intel GPU (Linux) on the other hand this works nice.
Any clues what I’m doing wrong here?
Thx in advance
Saski