PDA

View Full Version : Multisampled textures



debonair
11-16-2013, 01:32 AM
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?

Dark Photon
11-16-2013, 05:13 PM
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.

debonair
11-16-2013, 06:04 PM
Do you mean, what's the point of having them?

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?

Dark Photon
11-16-2013, 07:29 PM
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?

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.

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.