PDA

View Full Version : check for render-to-float-texture with blending?



Nighthawk
01-23-2009, 01:27 AM
Hi,

How should i check whether render-to-float-texture with alpha blending is supported in hardware?

Currently i check for the extension "GL_EXT_framebuffer_sRGB" since this works for my apps target platforms(Ati X800 and X3850), but i don't think this is the way it's meant to be done :p

Background:
I render to a FBO with alpha blending, and get minor banding artifacts after post-processing with GL_RGBA8.
When i use GL_RGBA16F_ARB the banding is fixed, but the X800 does not support that.

Any idea what the correct check is?

Brolingstanz
01-25-2009, 06:03 AM
http://www.opengl.org/wiki/Floating_point_and_mipmapping_and_filtering

Nighthawk
01-27-2009, 03:37 AM
Thanks for link... will search the wiki next time.

Too bad there is no platform independent way to check it.

So in theory the X800 could do the blending, but not the filtering(for my app the X800 would be too slow then anyhow).

Brolingstanz
01-27-2009, 04:40 AM
"Too bad there is no platform independent way to check it."

I don't think you'll hear any arguments there - that's the winner of 7 Razzies, including Worst Picture.

arekkusu
01-27-2009, 11:28 AM
The platform independent way is simple: "try it and see".

This is the same answer to every "does it work" or "how fast is it" question. When your app starts up, you go through a bunch of initialization, like checking the version and extension strings. During initialization, you can introspect anything else you want, like rendering precision or performance.

It's unfortunate there isn't an "ARB_float_blending" string for you to query. But you can still create the float surface you want to use, clear it to black, turn on blending, and draw a half-transparent white quad on it. If you get grey, congratulations, float blending works. Of course, it might have fallen back to software rasterization, so you'll probably want to benchmark it if you care about it being fast.