View Full Version : ARB_color_buffer_float help

05-21-2007, 07:30 PM

I am working on a blur example by using multiple FBOs. The program will makes objects blur when the object's color components are set greater than 1.0.

For example,
glColor3f( 2.0, 2.0, 2.0 );
glColor3f( .5, .5, .5 );

The first cube is going to be blurred.

The 3D rendering happens in a framebuffer object, so I can use the texture in the FBO to generate blur effects. Shaders are used to manipulate the texture. I try to make the shaders identify which fragments need to be blurred by its rgb values. If all the values are greater than 1.0, than the fragment need to be blurred.

The problem is in fragment shader, gl_Color is already clamped, even the rgb values are set greater than 1.0 in OpenGL program. So I found that ARB_color_buffer_float can make the rgb values in OpenGL program un-clamped. However, my Mobility Radeon 9600 does not support it. Wondering is there any other way to transfer the un-clamped values from OpenGL program to shaders?

05-22-2007, 12:47 AM
You could use uniform variables...

05-22-2007, 01:07 AM
Or vertex attributes.

glColor is actually a vertex attribute (you can define it separately for each vertex), but in your case you can use uniform variable since it's a constant you use once per object.

You could also use texture coordinate (this is also vertex attribute), but I suggest gong straight for uniforms or generic vertex attributes.

05-22-2007, 02:56 AM
Sounds like you need to render to a floating point texture.
There are other ways to do blur. Search for glow effect. It uses a regular RGBA8 texture and the alpha layer to know what needs to be blurred.

05-22-2007, 08:33 AM
I understood that he wants to pass a per-object floating-point parameter to the shader. Was I wrong?

05-22-2007, 09:04 AM
yes, I am using floating-point texture now. My mobility 9600 supports it. :)

I just got the idea of uniform variables before went to bed last night. I'll look at vertex attribute too.

Thanks guys.