PDA

View Full Version : opengl and transparency



giuseppe500
09-01-2011, 09:00 AM
hello.
I have created a sketchup importer.
I have imported all the faces and transformed it in triangles , then i transformed all to an unique coordinate system multiplying in a preprocessing phase all points for the world matrix and for his transform matrix , for have all in an homogeneous coord system.
at end i grouped all materials of the faces in some batch that are geometry that have the same material ,i do this because in sketchup i have all meshes divided in small faces and the call to the gpu otherwise would be too expensive.

Now i have minus meshes , because are grouped by material and i wish draw transparent objects.
Is possible in this scenario?
how if is possible?
is must sort the meshes ?

thanks

BionicBytes
09-02-2011, 01:43 AM
I don't think you have anything different from the usual scenareo, so the standard rules apply for transparency. Usually you draw the transparent geometry after all the opaque. The key to best looking transpareny is to depth sort the objects and render far to near.
Transparency is a difficult problem to solve completely and in the general case (as described) there will be certain cases where polygons are drawn in the wrong order giving artifacts. There are techniques which can be employed to tackle these issues but non are free as they will come with performance penalties and implmentation burdens.