Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

XBTC

Depth sorting of transparent polys?

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

Hi! Is there a fast + accurate method to depth sort transparent polys if I don´t have the center of the poly? The actual sorting is no prob I do it with qsort().... What I need to know is how to calc the distance between the player and the poly. I tried it with the plane equation but this dosn´t work in some cases(You can be infinetly far away of the poly but still be very near to it´s plane). Any ideas? P.s.: I tried it with the following method: I calculate the average of the distances between the player and the poly´s vertices. This gives me correct results, but I think it´s a waste of processing power....There has to be a faster solution.... Thanx in advance, XBTC!

Share this post


Link to post
Share on other sites
Advertisement
Just find the center of the poly by averaging the polys vertices, and then find the distance between the result and the player.

Also you could also get a little more speed by dropping the sqrt in this case.

Share this post


Link to post
Share on other sites
Hi!
Thanx for your help....

I already dropped the sqrt but averaging the vertices first would save some clocks.

P.s.: Perhaps I should use my bsp to sort the transparent faces but it is faster to traverse the tree without caring about the order and if I sort by texture afterwards it would only be a win for those few transparent faces.

Greets, XBTC!

Share this post


Link to post
Share on other sites

  • 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!