Jump to content
  • Advertisement
Sign in to follow this  
QuadMV

Problem with alpha and sorting for render

This topic is 4844 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

Hey guys, I’m sorting my billboards along the camera Z axis, and rendering furthest to nearest so the alpha displays correctly. I have it all working, but what’s happening now is that some of my objects sitting near each other have the same Z, and its luck of the draw which one draws first, but one will occlude part of the other and mess things up. How have other people dealt with this? I guess one option is to make sure objects can’t get too close to each other, or to split my billboard into smaller pieces. In my case they are trees, so 70%+ are transparent. I’m trying to create a thick wooded area, so many are very close to each other. Thanks for any suggestions. Quad

Share this post


Link to post
Share on other sites
Advertisement
Can you post a screenshot, to show what it looks like right now?

Your approach sounds fine to me. Using fixed point instead of floats might improve the precision of your sorting results.

Share this post


Link to post
Share on other sites
As an alternative to alpha blending, try using alpha test. With alpha test, you don't need to sort. The drawback is that the shapes will have hard edges, but if you are drawing a thick wooded area, it should still look ok.

Share this post


Link to post
Share on other sites
Is the problem that when the trees are at the same Z, one is drawn in front of the other, then at another frame, due to sorting, the other is drawn in front resulting in a flashing?

--Vic--

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!