Can FBOs do this?

Can FBOs be used to render to a texture and have it NOT clamp my floating-point values to [0, 1]? If it can, screw Pbuffers. FBO!

You sure can! If you have hardware that supports ARB_texture_float or ATI_texture_float, just render to a texture that uses an internal format specified by either of those extensions.

NV_float_buffer works great too.

Awesome! Screw pbuffers, I’m using FBOs instead! :smiley:

Strange errors… Here’s my code:

 
		glGenFramebuffersEXT(1, &i->fbo);
		glGenRenderbuffersEXT(1, &i->rbo);
		glGenTextures(1, &i->cubeMap);

		glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, i->fbo);

		// bind the RB
		glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, i->rbo);
		glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, SHADOWMAP_SIZE, SHADOWMAP_SIZE);
		glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, i->rbo);

		glBindTexture(GL_TEXTURE_CUBE_MAP, i->cubeMap);

		CHECK_FRAMEBUFFER_STATUS();

		glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
		glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
		glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
		glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

		// bind the faces?
		for (int x = 0; x < 6; x++)
		{
			glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + x, 0, GL_RGBA8, SHADOWMAP_SIZE, SHADOWMAP_SIZE, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
			glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X + x, i->cubeMap, 0);
			CHECK_FRAMEBUFFER_STATUS();
		}

		std::cout << "Done setup" << std::endl;
 

The first CHECK_FRAMEBUFFER_STATUS says that the fbo is incomplete because I haven’t attached anything to the color buffer of the FBO, which makes sense.

After the first and all additional calls to CHECK_FRAMEBUFFER_STATUS after I begin binding textures to the different faces, though, it returns GL_FRAMEBUFFER_UNSUPPORTED_EXT, and I’m not sure why. It does it no matter what format I have for the cubemap faces! I should probably point out that I’ve got a GF6800GT and forceware 75.90 drivers.

Try disabling mipmapping, that is, set the filters to GL_LINEAR or GL_NEAREST.

Still unsupported :frowning:

I just now copied and pasted the sample code from the Nvidia paper titled “OpenGL_FrameBuffer_Object.pdf” (You can google it if you want to read it), and I get the exact same error I’ve been getting with my code. Is something wrong with my system setup?

You need to unbind the texture before you can attach it to the FBO.

You must check render buffer status after specifying color attachment. Without color it render buffer incomplete.

About cubemaps see specification http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt:

If <texture> is a cubemap texture then, the value of FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE the named attachment point is set to <textarget>.

I solved it. It was due to my filtering on the cube map. Apparently my 6800GT doesn’t like bilinear filtering on cube maps bound to FBOs. :frowning: