Strange FBO+ATI+depth problem

How is it possible this code gives me a n incomplete fbo?

	GLuint fb, rtt, depth_rb, depth_stencil_rb;
	glGenFramebuffersEXT(1,&fb); 
	glGenTextures(1,&rtt); 

	glBindTexture(GL_TEXTURE_2D,rtt);  glTexImage2D(GL_TEXTURE_2D,0,GL_DEPTH_COMPONENT16,t->GetWidth(),t->GetHeight(),0,GL_DEPTH_COMPONENT,GL_UNSIGNED_BYTE,NULL);
		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,fb); 
		glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_DEPTH_ATTACHMENT_EXT,GL_TEXTURE_2D,rtt,0);
		glDrawBuffer(GL_NONE);
		glReadBuffer(GL_NONE);


	GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); 
	switch(status) 
	{ 
	case GL_FRAMEBUFFER_COMPLETE_EXT: 
		break; 
	case GL_FRAMEBUFFER_UNSUPPORTED_EXT: 
		throw sandra::error::RenderToTexture("Framebuffer object mode unssupported!"); 
		break; 
	default: /* programming error; will fail on all hardware */
		assert(0); 
	} 

It runs as expected on nvidia harware.

I’m not sure about this, but I think some Radeons don’t support depth-only FBO’s, so you need a color attachment.
I have an NVIDIA so I cannot confirm this.
Besides, your code does not check for GL_FRAMEBUFFER_INCOMPLETE_EXT - you have default option in your case block, but you should actually add separate option.
There3 are also some limitations on NVIDIA - if you need stencil then you should use packed_depth_stencil if available.

With old ATI driver, you must declare depth buffer as a render buffer and not a texture… I don’t know if it works now…

On nVidia, it works with render buffer and texture.

With old ATI driver, you must declare depth buffer as a render buffer and not a texture
Yeah - that’s what I heard. Sorry, looks like I mixed it up in my previous post when I wrote you need color attachment.

I have installed the latest ATI drivers but it didn’t resolv my problem. Thus, if you are right and ATI drivers doesn’t allow to attach a depth buffer as a texture… how the hell do I perform an optimal shadowmapping algorithm using FBO?

how the hell do I perform an optimal shadowmapping algorithm using FBO
Render to texture if supported and copy to texture if not. Your application will probably work a bit faster on NVIDIA, but perhaps NVIDIA deserved it in this case :slight_smile:

Ok. But I can’t understand how ATI drivers lack this feature being so important shdowmapping in these days.