FBO problems

In my program I am rendering to an FBO multiple times. On ATI/Nvidia this works perfectly. I check my FBOs when I create them and they give no errors (attach correctly). After a frame has completed rendering I call glGetError() no errors are received. It works fine.

Now … on Intel cards I have this strange problem where


does absolutely nothing. It just wont work. I can’t clear the colour or depth buffer, at the same time or independently.

On ATI/Nvidia it looks like this

On Intel …

I am really at a loss to explain this one. I’m at the point where I might have to try and simulate glClear just by drawing a quad with depth testing disabled.

Any ideas? I’m losing my hair here !

I don’t know if this is relevant, but are you setting the clear values before the glClear() call?

Maybe the drivers for the intel doesn’t keep this values as a state (just a guess).

What driver version/graphics card model? Can you post some code to show how you setup FBO?

It’s a mobile intel series (4) express chipset family
Common in laptops
Says its running opengl version 2.1

And yeah I am setting the clear colour before calling glclear. Theres a bunch of things gonna try today, flushing the pipeline before asking for the texture. I was using stencil when rendering to the back buffer, maybe that’s somehow effecting it.

Check if your FBO is complete after setup code.

From OpenGL 4.1 spec:

So, from this, do you have the scissor rect set to the area required + color/depth/stencil masks allowing clearing to occur.

The other difference I can see is that according to GLview, the Intel setup only supports GL_EXT_framebuffer_object, whereas NVidia + ATI cards probably support both GL_ARB_framebuffer_object + GL_EXT_framebuffer_object, so maybe there is some extra restriction that is relaxed with the ARB version of the extension?

Perhaps clearing the depth + stencil buffers at the same time might help too. If they are shared, then this should be faster than clearing them separately anyway.

glScissor ?
worth a shot …

How can I clear the depth buffer … without using glclear ?

Never mind I figured it out. Well, I figured out what’s going wrong. For some reason when i call
glClear it clears the viewport, but the size of a much smaller FBO …

Manually clearing the colour and depth buffers does work. This is really insane, I shouldn’t have to do this :frowning:

Well …
I got it to work using this code

	glEnable		(GL_DEPTH_TEST);
	glDepthFunc		(GL_GEQUAL);
	glLoadIdentity	();
	glMatrixMode	(GL_PROJECTION);
	glLoadIdentity	();

	glBegin			(GL_QUADS);
		glVertex3f	(-1,-1,1);
		glVertex3f	(1,-1,1);
		glVertex3f	(1,1,1);
		glVertex3f	(-1,1,1);
	glEnd			();

	glMatrixMode	(GL_MODELVIEW);
	glColor4f		(1.0f,1.0f,1.0f,1.0f);
	glDisable		(GL_DEPTH_TEST);
	glDepthFunc		(GL_LESS);

Which which manually, clears the colour and depth buffer. You can see the viewport is correct since the above code does what glClear fails to do …

But other problems occur

You can see the shadow has strange artifacts, again this doesn’t happen with Nvidia/ATI.

Anyone else try to code for Intel graphics cards? Intel market share is something like 50%, i’d like to try and support these things if possible … but driver bugs are really kicking my ass

I suggest making a fallback renderer for Intel chips that uses minimal functionality. They’re going to perform like crap anyways, so you might as well cut out all the features, instead of trying to run the same code on Intel chips and a real GPU.