That will work fine, but of course there’s still the problem of what to do if you DO want a stencil and depth buffer. I believe the problem is that ofFbo.cpp tries to do separate depth and stencil buffers when building for GLES, but iOS no longer supports that, it wants a single packed depth+stencil buffer. Trouble is, it is setup in a slightly different way to the current non-ES path, there’s no GL_DEPTH_STENCIL_ATTACHMENT in ES.
I’m pretty sure changing ofFbo::allocate(Settings _settings) to include the following is the right fix, but does anyone else want to weigh in? I’m no GL expert.
[...]
// If we want both a depth AND a stencil buffer tehn combine them into a single buffer
if( settings.useDepth && settings.useStencil )
{
#ifndef TARGET_OPENGLES
stencilBuffer = depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_STENCIL, GL_DEPTH_STENCIL_ATTACHMENT);
#else
stencilBuffer = depthBuffer = createAndAttachRenderbuffer(GL_DEPTH_STENCIL, GL_DEPTH_ATTACHMENT);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, stencilBuffer);
#endif
retainRB(depthBuffer);
retainRB(stencilBuffer);
}else
[...]
i’m really interesting in a small example how you’re using the fbo as stencil buffer,
i’ve been messing around a bit and inserted that patch from above,
but i can’t get anything to work (also: i have no idea what i’m doing )