Sign in to follow this  

Alpha sorting trees?

This topic is 1616 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 have a strategy game with some 1024 trees with 6 billboard sides each. How do games like SimCity 5 handle transparency? Is alpha sorting the non-intersecting parts of each tree the only way to get rid of the problems of rendering transparent polys in the wrong order? Is this computationally expensive?

Edited by polyfrag

Share this post


Link to post
Share on other sites

I'm not sure exactly what SimCity 5 does, but it's fairly common to disable alpha blending for trees and to just use alpha testing instead. That way, you don't have to do any distance sorting. If you were to do alpha-sorting, I believe you'd have to break up the billboards so that you have no intersecting pieces, and then you'd have to sort them on a polygon level using some sort of BSP tree, and then making a separate draw call for each polygon. Sounds expensive indeed. I suppose there might be some way to leverage depth peeling, but generally-speaking, doing a straight alpha test looks nice enough that a more-complicated solution is probably overkill.

Share this post


Link to post
Share on other sites

There's some interesting techniques in this presentation: http://www2.disney.co.uk/cms_res/blackrockstudio/pdf/Foliage_Rendering_in_Pure.pdf

 

One where they accumulate all the trees to a full-screen buffer using alpha-testing, and then blend that over the scene to get the soft edges you'd usually get from alpha-blending.

 

And another for their grass, where they pre-sort the polygons for n different directions, and then pick the closest match at runtime.

Share this post


Link to post
Share on other sites

This topic is 1616 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this