How do I init the framebuffer with depth and stencil on a device which does not support GL_OES_packed_depth_stencil
(In my case a Nexus 7 2012)?
This does not work:
glGenRenderbuffers(1, &depthStencil);
glBindRenderbuffer(GL_RENDERBUFFER, depthStencil);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8_OES, width, height);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthStencil);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, depthStencil);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
//...
You create separate renderbuffers for depth and stencil: