Page 1 of 1

Render Texture in iOS

Posted: Wed Feb 01, 2017 2:30 am
by ajmalk
I'm having trouble with rendering to an offscreen texture on opengles. I want to draw objects into a render texture and then draw using the render texture onto the screen. I'm using the ogl-es branch on iOS 10 and trying to render into a custom view in our cocoa app.

This is all I'm doing to instantiate the render target.
renderTargetTex = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "RTT1", video::ECF_A8R8G8B8);
video::ITexture* renderTargetDepth = driver->addRenderTargetTexture(core::dimension2d<u32>(256, 256), "DepthStencil", video::ECF_D16);

renderTarget = driver->addRenderTarget();
renderTarget->setTexture(renderTargetTex, renderTargetDepth);
When I run glCheckFramebufferStatus on the resulting frame buffer, I'm getting a GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT status. In all my research that status means one of the either the color texture or the depth texture are the wrong format or initialized improperly. What am I doing wrong here?