Has anyone done this successfully? It seems that any index format that I use in the stencil rendering buffer glCheckFramebufferStatus(...)returns GL_FRAMEBUFFER_UNSUPPORTED. I have successfully bound the \ color render depth buffer, but whenever I try to do the same with my stencil buffer, I get (as I said) GL_FRAMEBUFFER_UNSUPPORTED.
Here are the snippets of my code:
GLuint fb;
glGenFramebuffers(1, &fb);
GLuint sb;
glGenRenderbuffers(1, &sb);
glBindRenderbuffer(GL_RENDERBUFFER, sb);
glRenderbufferStorage(GL_RENDERBUFFER, GL_STENCIL_INDEX8, w, h);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, cb, 0);
glBindFramebuffer(GL_FRAMEBUFFER, fb);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rb);
Any ideas?
Note. Color pinning is a texture, not a rendering buffer.
source
share