Original Post
Hi everyone, I am trying to use fbo's to render an object directly into a texture. This works fine except that the depth_test seems to be disabled. Is there any way to enable the depth_test while rendering into the texture? I've allready tried to attach an renderbufferObject for the depth but the texture seems to be totaly wrong after that. Here is my code: glewInit(); //check if framebuffer objects are supported fbo = glewGetExtension("GL_EXT_framebuffer_object");//fbo = false; //if framebuffer objects are supported, create one for the gbuffer if (fbo) { glEnable(GL_DEPTH_TEST); glGenFramebuffersEXT(1, &fb); } ... if (fbo) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); glEnable(GL_DEPTH_TEST); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, texture, 0); } ... /*draw something*/ Can anyone help me? I am using fbo's for the first time so maybe there is just a little mistake. Thanks in advance