Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transparent objects



Hi Lorenzo,
I second that you should look into a technique called "Depth Peeling". It's a multi-pass algorithm (one pass per "peel") that can do the sort of accumulation that you are thinking about. NVidia wrote a paper on it, and I think they have a good tutorial, too. I have used this technique (although not on really high geometry scenes) successfully.


If the multi-pass aspect of it turns out to not be as fast as you need, perhaps it would be a good idea to sort your geometry and check for collisions in all of the trivial cases.

Chris

From: Lorenzo <email@hidden>
Subject: Re: Transparent objects
To: Chaz McGarvey <email@hidden>
Cc: Mac List <email@hidden>

Thank you Chaz,
the problem is that it's an animation. So the objects could be once on the
back and once on the front. They not only change order but also rotate, so
how can I know whether an object is in front or on the back? Think about an
half-trasparent-cube with 6 faces, plus an opaque cylinder crossing through
the cube from outside to inside.


If I disable the depth test of the cube and I draw firstly the cube then the
cylinder, I see the internal part of the cylinder drawn outside the cube
(instead that part is "inside" the cube!).
And If I disable the depth test of the cube and I draw firstly the cylinder
then the cube, I see the external part of the cylinder drawn inside the cube
(instead that part is "outise" the cube!).


So, I really think that this is not the way to proceed. I presume I can
solve this with some accumulation z buffer, collecting any object depth then
drawing all the objects at the end. But I don't know whether this method
exists or not.


Is anyone here who knows how to solve this "transparent" problem? Please.
There should be a solution, for sure!



Best Regards -- Lorenzo email: email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.