Drawing a mixture of opaque & translucent panels

I have a 3D model of a car Wherin the car glasses are translucent and rest all are opaque. What should be the general approach taken to render the car properly?

This is covered in the red book. Render the opaque parts, then render the translucent parts in far-to-near order.

To avoid depth sorting and since it’s a game (so an occasional artifact may be acceptable) there are some tricks you could use. You could use back face culling to draw only near windows. You could do front face culling and then back face culling, drawing the transparent things in two passes.

Originally posted by endash:
To avoid depth sorting and since it’s a game (so an occasional artifact may be acceptable) there are some tricks you could use. You could use back face culling to draw only near windows. You could do front face culling and then back face culling, drawing the transparent things in two passes.

This one works only if the transparent object you are drawing is a convex volume, in all other situations it will fail.

Very true. I was figuring that most cars (or at least the windows) are convex. The set of all car windows may not be convex, however, in which case you’ll get an artifact half of the times that one car passes another and you can see through one’s window into the other’s.

Thanks guys!

Originally posted by endash:
Very true. I was figuring that most cars (or at least the windows) are convex. The set of all car windows may not be convex, however, in which case you’ll get an artifact half of the times that one car passes another and you can see through one’s window into the other’s.