🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Alpha blending approaches

Started by
1 comment, last by JoeJ 3 years, 4 months ago

The usual approach to alpha blending is to sort objects by depth and render the back ones first. This usually has to be done outside the GPU, so it's a performance problem.

There are some ways to cheat. One is to not update the Z-buffer for translucent pixels, so even if the translucent layer is drawn first, the non-translucent layer overrides it. If the rendered image contains an alpha component (so you have RGBAZ channels) you can do that reasonably well. But it causes trouble if the translucent image has a color.

A big usage of translucency is windows. (Windows In buildings and vehicles, not on displays.) It might be worth identifying the textures which 1) specify alpha blending, 2) have alpha values not near 0 or 1 alongside RGB values not near grey. Only those textures really need a depth sort. Shades of grey can be done in the GPU.

Anyone been down this road?

Advertisement

No experience with anything, but i can imagine weighted OIT could do well for windows, as there usually are not too many overlaps:

There was a paper from Morgan McGuire in case you missed it.

This topic is closed to new replies.

Advertisement