View Full Version : Order Indep. Transparency & Depth_replace
10-19-2003, 04:55 AM
I've been looking at the Order Independent Transparency paper by Cass Everitt, from the Nvidia site. The idea is to peel away layers by using a shadow map to drop fragments that are too close, while using the regular ZBuffer to make sure that only the closest fragment passing the shadow test affects RGB.
What I can't figure out is how depth_replace fits into the picture. The straightforward way to do the peeling seems to be, move xyzw into strq and set texture matrix == projection * modelview. At what point would one want to change the rendered fragment's Z ??
I must be missing something http://www.opengl.org/discussion_boards/ubb/smile.gif
On NV2x hardware depth_replace was required for depth invariance. So that peeling matched exactly.
On NV3x (GeForce FX) depth replace is not required.
10-19-2003, 02:36 PM
Where can I download a demo (w/src if possible) of this effect?
10-20-2003, 03:12 AM
thanks for the update !
Do you mean that with NV2x, the final s,t is not accurate enough to access eg a 1024x1024 map with some certainty that you're grabbing the right pixel ?
I can see how depth_replace helps with this, but I'm still not sure how you'd route the resulting Z to the shadowmap side of the comparison, and not the fragment side..?
10-20-2003, 04:05 AM
You use the shadow mapping functionality to compare a depth component (from a texture) to a texture coordinate (generated such that R=Z). However, texture coordinates are interpolated differently from depth. Depth is interpolated linearly, whereas texture coordinates are interpolated with perspective correction. See section 3.4.1 of the spec.
This means that your shadow map depths and your texture coordinate depths are not necessarily the same after interpolation, so your depth comparison is hosed. To get around this, depth replace can be used to override the linearly interpolated depth values with perspective-corrected values. Only then can you perform a meaningful depth comparison to do your depth peeling.
Right - what Tom said. http://www.opengl.org/discussion_boards/ubb/smile.gif
Also, On GeForceFX, you depth peel by doing
TEX R0, f[WPOS], TEX0, RECT;
And f[WPOS] is interpolated such that it is invariant with fixed-function depth.
10-23-2003, 03:46 PM
Wouldn't you know, I think the fog is starting to clear http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks guys !
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.