View Single Post
Old 05-15-09, 03:35 AM   #2
NVIDIA Corporation
AaronP's Avatar
Join Date: Mar 2005
Posts: 2,487
Default Re: Depth peeling, multisample buffer, 177.78

Sorry for the very slow response on this. This was investigated and determined not to be a bug:
Originally Posted by OpenGL developer
The first depth peeling step eliminates the front face of the cube, and the following step is supposed to eliminate the rest of the cube. The third pass is supposed to discard every fragment, as they were all rendered in the previous step. With a multisample buffer, however, the left and top faces of the cube are not being discarded.

In summary, this test relies on a comparison using shadow2DRect between a downsampled texture containing the depth buffer from the previous pass and the multisampled buffer (with the same geometry, nothing changed) from the current pass to work the same as if there was no multisample buffer.

The OpenGL spec 3.3.1 (Multisampling) states:
If MULTISAMPLE is disabled, multisample rasterization of all primitives is
equivalent to single-sample (fragment-center) rasterization, except that the frag-
ment coverage value is set to full coverage. The color and depth values and the
sets of texture coordinates may all be set to the values that would have been as-
signed by single-sample rasterization, or they may be assigned as described below
for multisample rasterization.

This seems to explain why the test isn't behaving as the user expects; disabling GL_MULTISAMPLE does not "turn off multisampling", it just disables the alpha multiplication of the rasterized fragment (as described at the beginning of 3.3). This also implies that the fact that this behavior changed post-G80 is not necessarily wrong.

Note the developer can probably accomplish multisample rendering + depth peeling, which I assume is what they really want, with GL_EXT_framebuffer_multisample.
I hope that helps!
AaronP is offline   Reply With Quote