[osg-users] how to get an unclamped float color buffer?

Ralph Kern usenet04 at rk-se.de
Thu Oct 25 08:50:49 PDT 2007

John Donovan schrieb:
> Ralph Kern wrote:
>> Hi,
>> I now managed to get true float values out of the render buffer by
>> specifying
>>>> 	image = new osg::Image;
>>>> 	image->allocateImage(width, height, 1, GL_RGB, GL_FLOAT);
>>>> 	image->setInternalTextureFormat(GL_RGB32F_ARB);
>>>> 	viewer->getCamera()->attach(osg::Camera::COLOR_BUFFER, image.get());
>> But the values are still clamped to 1.0. Any idea to get around that?
>> regards Ralph
> A fragment shader is what you need I think. Make sure you write to gl_FragData
> rather than gl_FragColor, otherwise it'll still be clamped.
> I'm a bit busy at the moment, so I can't help you further, but I'm sure others
> will be generous with their time :)
> -J

Thanks, you're right. Writing to gl_FragData[0] in the fragment shader
gives unclamped results in my setup.



More information about the osg-users mailing list