Sign in to follow this  
Quat

alpha blending

Recommended Posts

I am alpha blending between 500-1000 overlapping polygons per frame. Each polygon makes a small contribution (that is, the opacity is very small). For example, after the pixel shader, a pixel may have opacity 0.007. The problem seems to be in mapping 0.007-->[0,255] on the back buffer. I lose a lot of accuracy in this conversion and when blending 500-1000 polygons, the accuracy has a significant impact on the final display. Is my only option to use a floating-point render target? Then draw that to the back buffer in the final step after all the blending? How widely supported are floating-point render targets these days? Is floating-point blending pretty cheap if the hardware supports it?

Share this post


Link to post
Share on other sites
Yes, your opacity is getting mapped to [0 - 255]. The alpha component is the A in ARGB. ARGB is a 32 bit integer, 1 byte per component.

I can't talk about floating point render targets because I haven't used them yet.

Share this post


Link to post
Share on other sites
Floating point support varies. nVidia started supporting it in the 6x00 line. ATI had support in the 9x00 line I think. Support varies between FP16 and FP32. Some cards will filter (nVidia 6x00 or newer, and ATI DX10 and 10.1 cards). Some cards will blend (not sure which. I think nVidia w/ FP16 only. Technically alphatest counts as blending here, but you can emulate it with HLSL clip.). Some cards will blend when using MRT (nVidia. ATI won't).

The sad state of FP support in DX9 is probably a large contributor to why D3D10 was a fixed spec, rather than a set of hundreds of optional bits.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this