Drawing alpha-tested foliage nicely (WARNING: image heavy)

Started by
37 comments, last by DonnieDarko 16 years, 9 months ago
Alpha-to-coverage seemed to work without AA, in that it drew the transparent areas using some kind of dithering. That's why I wasn't impressed. It definitely sounds like I didn't use it in its best light though, so will have to have another go.
Advertisement
Quote:Original post by PlayerX
Alpha-to-coverage seemed to work without AA, in that it drew the transparent areas using some kind of dithering. That's why I wasn't impressed. It definitely sounds like I didn't use it in its best light though, so will have to have another go.

Hmm interesting, I just assumed it would do nothing w/o the anti-aliasing hardware being active. In any case, sub-pixel screen-door should certainly still look better than otherwise, so give it a go and see if you like the results.
I had the opportunity to throw in alpha-to-coverage tests. Here are the results. Again, excuse the artifacts at the edges of the leaves; this is a texture clamping error.

Close up, respectively: alpha-blending only, alpha-testing only, blending and testing, two-pass, alpha-to-coverage.




Farther away.




Distant.




You were right, alpha-to-coverage doesn't work at all without anti-aliasing enabled - I must've had AA going when I experimented with it earlier. The above shots were taken with 16x AA on a GF7.

Personally I feel the two-pass method produces the best results. Alpha-to-coverage seemed to be barely better than alpha-testing alone as it didn't look good when moving and the stippled nature of close-ups looks nasty. It's a nice alternative, though, when you have so much foliage you can't afford to render it twice. But if you've got the odd tree or three and small clumps of scrub grass so rendering them twice would be unnoticeable, the two-pass method produces nicer results IMHO.

Do the alpha-to-coverage screen-shots reflect what you're getting, or am I doing something wrong?
Quote:Original post by PlayerX
You were right, alpha-to-coverage doesn't work at all without anti-aliasing enabled - I must've had AA going when I experimented with it earlier. The above shots were taken with 16x AA on a GF7.

16x AA on GF7?? Try 4x for comparison since IIRC GF7 can only do 4 "real" MSAA samples (GF8 can do 8).

Quote:Original post by PlayerX
Do the alpha-to-coverage screen-shots reflect what you're getting, or am I doing something wrong?

Those look remarkably bad compared to what I've seen actually. Unfortunately I don't have an example handy (it was at work when I was trying this all out a year or two ago), but I'll see what I can dig up when I get a chance...
in my gf7's application settings u can choose 8xAA

yes i also thought the alphato coverage shots looked worst than i though, so i fired up one of my apps that does it, and yep it does look a lot worse than i thought. though better than plain alpha testing.
the beauty with alpha to coverage though it works with depthtesting, playerX your method does also but it requires u to draw the (expensive) alpha geometry twice, thus its a lot slower
Quote:Original post by zedz
in my gf7's application settings u can choose 8xAA

Yes but IIRC 8xS AA (or whatever it's called - something like that) is a hybrid mode that does 2x super-sampling with 4x MSAA.
Quote:16x AA on GF7?? Try 4x for comparison since IIRC GF7 can only do 4 "real" MSAA samples (GF8 can do 8).

I tried 4x AA as well. I only showed the 16x because it looked better. GF7 can do 16x AA in an SLI configuration.
Quote:the beauty with alpha to coverage though it works with depthtesting, playerX your method does also but it requires u to draw the (expensive) alpha geometry twice, thus its a lot slower

Yep. It's not a win when you have lots of foliage. But if you don't, then it beats the other methods in quality. What the pictures don't show above is how nice it looks when moving. Personally I reckon give the player the option of the method to use. Have a slider in the graphics settings tab for foliage; Speed vs Quality.

I've seen quite a few games that don't have much foliage though, but still use alpha-testing for them. These games could definitely benefit from the two-pass.
Quote:Original post by PlayerX
I tried 4x AA as well. I only showed the 16x because it looked better. GF7 can do 16x AA in an SLI configuration.

Ahh, SLI, right! I always forget about that... Still looks surprisingly bad for 16 samples (that should give 16 distinct levels of alpha).

Anyways definitely always good to have another method available in the toolbox :)
Quote:Original post by AndyTX

Those look remarkably bad compared to what I've seen actually.


That's because these shots are a worst-case scenario--black tree with fine detail against a light background.. is guarenteed to look bad with alpha-to-coverage.

In my experience, A2C is far better than this two-pass method, which is terrible for fillrate. Imagine doing a grass field with the two pass method...impossible. How often do you just have one tree standing alone?

Also this is very low-poly-looking tree; most trees in modern applications are higher poly, 5000-8000 at the nearest LOD with a LOT of overdraw for dense foliage. The two-pass method is a clear loser.

Quote:Original post by AndyTX
Quote:Original post by zedz
in my gf7's application settings u can choose 8xAA

Yes but IIRC 8xS AA (or whatever it's called - something like that) is a hybrid mode that does 2x super-sampling with 4x MSAA.

does it!!
strange it just saiz 8x in the settings, yould think theyld advertise it as such
after all 2x super-sampling with 4x MSAA is certainly better than 8xMSAA.

no wonder performance always dived when i turned it on

This topic is closed to new replies.

Advertisement