Skip to main content
GameDev.net gamedev.net
🔒 Locked

How to handle transparent objects

Started by ECrevecoeur Aug 9, 2006 at 7:44 PM 2 replies 600+ views
Original Post
ECrevecoeur
ECrevecoeur
Hi I am currently building a render engine and I was wondering what are best techniques to handle transparent objects. Any and all advice would be greatly appreciated thanks. :)
JohnBolton
JohnBolton
You have to draw alpha-blended triangles last, from back to front. So when you submit your object for rendering, triangles with alpha blending (which would probably use a separate material than the opaque triangles) would go in a list that is later sorted from back to front. If you assume the objects in the alpha-blended list don't intersect, then you can reduce material changes by sorting the alpha-blended objects back-to-front and then sort the triangles in each object back to front.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
godmodder
godmodder
You should also take a look at the "Alpha Blending in a texture" tutorial at codesampler.com, they use a cool trick so you can avoid the explicit sorting of the transparent geometry. You could also google for "destination alpha", which will also remove some of the issues with transparent objects.

Hope I've been able to help,
Jeroen

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.