ofxFBOTexture & ofx3dModelLoader

Hi all,

I tried to render the squirrel example in a FBO, but i have some strange artefacts, like missing faces.
( without FBO it works fine )

after doing some testing looks like there is no depth test while using FBO, probably need to enable the depth buffer.

thanks all.

Two thoughts: (first, really simple one) check which version of the ofxFBOTexture you’re using and in particular if it contains the lines:

  
				glGenRenderbuffersEXT(1, &depthBuffer);  
		glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depthBuffer);  
		glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, texData.tex_w, texData.tex_h);  
		glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depthBuffer);  

also, how are you drawing the rabbit? I’m not sure that the depth will be enabled if you’re just calling model.draw() after fbo.begin(), maybe you need to explicitly enable the depth buffering in there?

You could also try using multisampling on the fbo to see if that changes anything, just:

  
fbo.allocate(width, height, GL_RGBA, 4);