Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Correct method to rendering Tree foliage with alpha channel

This topic is 3691 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am rendering a tree with leafs and the polygons are textured with an RGBA and I am trying to get them all to render, but the only way is if I shutdown depth writes... So what is the correct way of doing this, and is there a simple way to do it. Thanks

Share this post


Link to post
Share on other sites
Advertisement
You can leave depth writes on as long as you use alpha testing instead of alpha blending.

Contrary to popular belief, you can still get really nice smooth/curved edges with alpha testing, you've just got to make the alpha cut-off at 50% and make your alpha channels a nice smooth gradient (instead of a traditional on/off alpha-mask).
The gradient allows the alpha channel data to be interpolated (by the GPU's texure-filtering) much, much better - preserving the original curves even when up-scaling the texture. Look up "distance fields" or the paper "Improved Alpha-Tested Magnification for Vector Textures and Special Effects" for info.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!