FBO driving me crazy..

Please forgive me if I am doing something stupid but:
I just CANNOT get a working FBO…
Running the nvidia drivers 76.41, and using glew 1.3.2 for initialisation.

No matter what I seem to try I get a GL_FRAMEBUFFER_UNSUPPORTED_EXT return.
I have tried turning on and off depth testing, selecting GL_NONE as my drawbuffer, RGB and RGBA formats, and am fast running out of ideas.

Some people have mentioned changing control panel options, any ideas which?

I have tried literally dozens and dozens of combinations, with no luck at present. I REALLY do not want to go back to pbuffers…

I dont even need a texture for the colour target, although a renderbuffer works no better, as I only want to read the RGBA back out to memory.

Any help would be greatly appreciated.

I do the following:
glGenFramebuffersEXT(1,tmpbuffer)
self.fb=tmpbuffer[0]
glGenRenderbuffersEXT(2,tmpbuffer)
self.rb=tmpbuffer[0]
self.depth=tmpbuffer[1]
glGenTextures(1,tmpbuffer)
self.tex=tmpbuffer[0]
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,self.fb)

#texture method
glBindTexture(GL_TEXTURE_2D,self.tex)
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA8,512,512,0,GL_RGBA,GL_UNSIGNED_BYTE,0)
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST)
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,self.tex,0)

#renderbuffer method
#glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,self.rb)
#glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_RGBA8,512,512)
#glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_RENDERBUFFER_EXT,self.rb)

glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,self.depth)
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_DEPTH_COMPONENT24,512,512)
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,GL_DEPTH_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,self.depth)

status=glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)
if status!=GL_FRAMEBUFFER_COMPLETE_EXT:
print “framebuffer error status=”,<int>status

I’m using GLee and I got them to work pretty decently in a couple of demos.

you can try to download demos, which are in the NVIDIA Forceware 75.90 => OpenGL 2.0.0 & fbo thread. I think someone posted one and i posted one on using floating buffer on NV3x hw. So download them and try . If you get still the same error, go to control panel, set/unset every setting and try to reinstall driver. It helped me :slight_smile:

Try these two demos and tell me what does the lower left panel says. If FBO is detected, it will display GL_FRAMEBUFFER_EXT, otherwise they will fall back to using PBuffers.

Screenshot 1
Screenshot 2
Binaries

Screenshot
Binaries

First try this check to make sure you are supported.

CHECK_FRAMEBUFFER_STATUS() 
{ 
	printf("Checking framebuffer status.
");
	GLenum status; 
	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); 
	switch(status) { 
		case GL_FRAMEBUFFER_COMPLETE_EXT: 
		printf("Framebuffer complete.
");
		break; 
		case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
		printf("Framebuffer unsupported.
");
		/* choose different formats */ 
		break; 
		default: 
		/* programming error; will fail on all hardware */ 
		assert(0); 
	}
}  

Other than that doesnt look much different than mine, myabe your ourdeing is wrong, do u get it working and only getting a black or white screen?

Anyway here is what i’m doing

 glGenTextures(1,&color_tex);
glBindTexture(GL_TEXTURE_2D,color_tex);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,512,512,0,GL_RGBA,GL_INT,0);
			
glGenRenderbuffersEXT(1, &depth_rb);
//initialize depth renderbuffer
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,depth_rb);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT,GL_DEPTH_COMPONENT24,512,512);

glGenFramebuffersEXT(1, &fb);
//initialize frame buffers	
		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb);        
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,GL_COLOR_ATTACHMENT0_EXT,GL_TEXTURE_2D,color_tex,0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT,GL_DEPTH_ATTACHMENT_EXT,GL_RENDERBUFFER_EXT,depth_rb);

CHECK_FRAMEBUFFER_STATUS(); 

Originally posted by Java Cool Dude:
Try these two demos and tell me what does the lower left panel says. If FBO is detected, it will display GL_FRAMEBUFFER_EXT, otherwise they will fall back to using PBuffers.

Thank you for that, I have already run the second demo, and it certainly does use GL_FRAMEBUFFER_EXT, so I’m pretty sure I have basic driver support, there is just something subtle about getting it to hook…

I guess I will just have to keep playing at things and hope I find the right combination.

Since everyone is writing demos :slight_smile: -> http://www.reallyslick.com/src/fbo.zip

Mine is very simple; just enough to prove to myself that FBO works and is really cool. I really like how simple the API is.

Try adding

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST)

I too kept getting the UNSUPPORTED_FORMAT error when I left out the MAG and MIN filter settings.

Originally posted by glkat:
[b]Try adding

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST)

I too kept getting the UNSUPPORTED_FORMAT error when I left out the MAG and MIN filter settings.[/b]
Well, spotted, damn my poor cut/paste ability, that was 1/2 the problem! I also played with the order of a few other things and now seem to have it working.

Interestingly now the pure 2 Renderbuffer (depth+colour) method also works, which shows that it was not just the bungled texparameter :stuck_out_tongue:

At present this stuff seems to be VERY sensitive to setup order, oh well so long as something works.