PDA

View Full Version : Drawing a mixture of opaque & translucent panels



butcher
02-13-2004, 05:15 AM
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?

endash
02-13-2004, 08:30 AM
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.

crystall
02-13-2004, 01:06 PM
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.

endash
02-13-2004, 01:15 PM
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.

butcher
02-14-2004, 09:24 PM
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.