Thick alpha glass without sorting? please help

Started by
-1 comments, last by Prune 16 years, 6 months ago
I'm rendering liquid (which uses refraction shader from a cubemap) in glass, where the glass has no refraction, just cubemap reflections, and instead is simply alpha transparent to show the liquid inside and the background. I want to _not_ render the inside of the glass when it is seen through the front of the glass facing the user, just have it visible through the opening of the glass. So basically I don't want layering of transparencies, just the frontmost glass layer alpha blending with the liquid and background which already have been rendered. Otherwise, the illusion of glass is ruined because the the inner glass surface will have a sharp cutoff at the silhouette edges of the glass giving a cross-section type look. With sorting it's easy to achieve by rendering the glass front to back, since any covered glass surface will fail the depth test (i.e. backwards from the usual way alpha polygons are rendered). But sorting is slow, and the glass geometry is complex due to curves (and there's more than one). How do I pull this off?
"But who prays for Satan? Who, in eighteen centuries, has had the common humanity to pray for the one sinner that needed it most?" --Mark Twain

~~~~~~~~~~~~~~~Looking for a high-performance, easy to use, and lightweight math library? http://www.cmldev.net/ (note: I'm not associated with that project; just a user)

This topic is closed to new replies.

Advertisement