floating point in an FBO on a GeForce6600 GT

Started by
2 comments, last by Zarathustra 16 years, 4 months ago

void initFBO()
{
// Create the  2 FBOs and associated things
	for (int i = 0; i < NUM_FRAMEBUFFERS; ++i)	{
		glGenFramebuffersEXT(1, &fb.fbobj);
		glGenTextures(1, &fb.texobj);
	}
	glGenRenderbuffersEXT(1, &fbo_depth_renderbuffer);

	//FBO's will have the size of the window
	fbo_width = width;
	fbo_height = height;

//Initialize the first FBO, the one in which we render the raw lighting data in HDR
	//the buffer for the color data
	glBindTexture(GL_TEXTURE_2D, fb[0].texobj);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, fbo_width, fbo_height, 0, GL_RGBA, GL_FLOAT, NULL);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glBindTexture(GL_TEXTURE_2D, 0);
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb[0].fbobj);
	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,	GL_TEXTURE_2D, fb[0].texobj, 0);


	//the buffer for the depth data
	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, fbo_depth_renderbuffer);
	glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, fbo_width, fbo_height);
	glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);

	// Attach the depth renderbuffer to framebuffer 0
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb[0].fbobj);
	glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, fbo_depth_renderbuffer);
	std::cout<<"FBO 1 made"<<std::endl;

//Initialize the second FBO, the one to which we render the tonemapped data.
	//only a buffer for color data needed
	glBindTexture(GL_TEXTURE_2D, fb[1].texobj);
	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, fbo_width, fbo_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
	glBindTexture(GL_TEXTURE_2D, 0);
	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb[1].fbobj);
	glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,	GL_TEXTURE_2D, fb[1].texobj, 0);
	std::cout<<"FBO 2 made"<<std::endl;

	for (int i = 0; i < NUM_FRAMEBUFFERS; ++i)
		{
			glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb.fbobj);
			GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
			switch(status)
		{
			case GL_FRAMEBUFFER_COMPLETE_EXT:
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
				printf("Error!  %s missing a required image/buffer attachment!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
				printf("Error!  %s has no images/buffers attached!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
				printf("Error!  %s has mismatched image/buffer dimensions!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
				printf("Error!  %s's colorbuffer attachments have different types!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
				printf("Error!  %s trying to draw to non-attached color buffer!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
				printf("Error!  %s trying to read from a non-attached color buffer!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
				printf("Error!  %s format is not supported by current graphics card/driver!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
			default:
				printf("*UNKNOWN ERROR* reported from glCheckFramebufferStatusEXT() for %s!\n", "FBO");
				std::cout<<i<<std::endl;
				break;
		}
		}
}


Above is my FBO initialization code, it works like a chamr on my one PC with a 7800GT in it, but on the 6600GT it doesn't seem to work. I always get the "case GL_FRAMEBUFFER_UNSUPPORTED_EXT:" Error on both FBO's. Anyone any idea what causes this and which format I could replace the faulty one with ?
Advertisement
What drivers are you using? Have you tried 32bit RGBA FP for a format?
I had similar problems with my 6800GT. You'll probably need:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);

Regards
elFarto
No result elFarto :(

and atm the 77.50 drivers (I'm gonna update now)

Als the 32 bit format doesn't change anything. What I think is weird is that it gives the error for both framebuffers, I mean the second one uses a very basic format so I don't get it :/


edit: good news! I updated my drivers to the forceware 163 version and now it didn't give the error but still a black screen. But if I remove the added code from elFarto it works \o/ I have no idea why that extra piece of code would screw it up but apparenlty it did on those drivers.

[Edited by - Zarathustra on December 3, 2007 5:42:49 AM]

This topic is closed to new replies.

Advertisement