Skip to main content
GameDev.net gamedev.net
🔒 Locked

Transparency AA

Started by godmodder Aug 22, 2006 at 9:42 AM 3 replies 2.1k views
Original Post
godmodder
godmodder
Hello, everyone, I'm rendering a lot of grass and trees as alpha tested billboards in my engine and I wanted to improve the quality of them by letting geforce 6/7 cards perform tranparency AA on them. (multisampling or supersampling) The problem is: I don't know if it's possible in OpenGL. I've seen alot of resources (including the nVidia ones), but they're all written for Direct3D. The only thing I came across in OpenGL that resembles the functionality somewhat is GL_SAMPLE_ALPHA_TO_COVERAGE (www.humus.ca has a demo). Is it possible to use transparency AA in OpenGL? If so, how do I enable it? Thanx in advance for any help, Jeroen
Nik02
Nik02
The technique is actually alpha to coverage in Direct3D also, so I think that the OpenGL equivalent does the exactly same thing.
Niko Suni
Dtag
Dtag
Its really simple.
You just need to do this while rendering your alpha tested stuff:

glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);

The only thing you need to watch out for is that AntiAliasing is at least 2x ( or it won't work at all ). Note that the Anti Aliasing setting will also influence the quality of the alpha to coverage.

As for the performance, it didnt turn out to be very efficient for me. Alpha to Coverage seems to be a pretty fillrate hungry effect. I actually found it alot more efficient to actually render alpha_blended_ grass. As for the trees I sticked to alphatesting.
godmodder
godmodder
Thanx for the replies everyone. This was exactly the info I needed. I've enabled the extension and now all the vegetation in my games look better!

Thanx,
Jeroen

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.