How to handle transparent objects

Started by
2 comments, last by ECrevecoeur 17 years, 8 months ago
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. :)
Advertisement
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!
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
thanks guys

This topic is closed to new replies.

Advertisement