Which operations can be effective in fragment shader for multisampled depth textures? I mean, for RGBA textures, we could just take average of color values came from texelFetch().
What should be ideal shader code for multisampled depth texture?
I don't understand your question. Do you mean, what's the point of having them?
Think about the edge AA benefits of rasterizing to an MSAA window. Same benefits go to rasterizing to an MSAA texture or renderbuffer attached to an FBO.
No, I mean for RGBA textures, we can average the color values for all the samples. But is it the good way in case of depth textures?
Originally Posted by Dark Photon
With standard MSAA rasterization, the MSAA depth buffer is only used to capture subsample MSAA color information properly. What you really want is the downsampled color, not the downsampled depth.
Originally Posted by debonair
So why are you concerned about how to downsample the depth buffer?
Averaging depths doesn't really have any useful meaning. What makes more sense (considering shadow maps, which is just a depth buffer afterall) is something like what PCF does, where multiple depth compares are done per-texel/sample and then the boolean comparison results are averaged.
Last edited by Dark Photon; 11-21-2013 at 06:12 PM.