Nonmaskable/Maskable Multisampling

Started by
2 comments, last by discman1028 18 years ago
Can anybody explain the difference? Is maskable for Adaptive AA? [Edited by - discman1028 on May 15, 2006 1:41:32 PM]
--== discman1028 ==--
Advertisement
It seems to be direct3d specific... linky. But I am still unclear. It seems a few others have had the question, and no response. And I've asked a few experts directly, who weren't sure.

Actually, Demirug had given me a pretty good answer earlier, but I am wondering still if maskable is used for Adaptive AA.

Quote:Demirug:


Every multisampling mode can support different levels of quality. This can be an improved sample mask or a better down filter. In the case of non mask able buffers the quality can stand for different numbers of samples, too. But two different quality’s can still have the same sample count.

Direct3D supports mask able and non mask able multisampling buffers. The different is that you can set a write mask for mask able buffers. This mask decides in which of your buffers are written. This can be used for effects like transparency or motion blur but you will lose the anti aliasing in this case. I am had used mask able multisampling buffers to add an anti aliasing effect for alpha tests. If you create a non mask able buffer you can’t use this mask and the multisampling buffer is only used for default anti aliasing.

Direct3D defines no direct matching between the quality levels og non mask able buffers and the different mask able buffers. nVidia GPUs as example can use 2 and 4 sample mask able modes but support 4 different non mask able modes.

If your card supports D3DMULTISAMPLE_5_SAMPLES it uses 5 subsamples per pixel. It is the same with all other modes.

--== discman1028 ==--
Quote:Original post by discman1028
Can anybody explain the difference? Is maskable for Adaptive AA?


No. Maskable is not adaptative AA (and even if you could try to emulate the workings of transparency AA supersampling, the API doesn't give you enough info).

Maskable samples just mean that the samples are "explicit" instead of implicit. And if maskable samples are supported, you can actually use a MASK to write ONLY to those samples (it's not possible for ALL AA modes that's why you need this to be supported explicitely).

The way it works is like this :
each pixel, the hardware computes a mask from the geometry (full mask if the pixel is inside the triangle, half the mask if the pixel is half insider the triangle and half outside the triangle). Then this mask is ANDed with the mask that you specified as a render state. If you selected the 4X_Maskable that means that the mask contains exactly 4 bits. That way you can redirect rendering to only one fourth of the final samples.

The difference with an implicit format seems a bit rethoric to you ? here's a example of a true implicit format : Quincunx. There are five taps per pixel. But you can only differentiate two of them (because some taps are shared with the neighboring pixel). Another example is supersampling (though you cannot enable supersampling from the API), in 4x supersampling there is four taps per pixels, but you cannot mask them individually. Yet another is powerVR older implementations, or Matrox FAA (fragment AA).

Quincunx is the reason why there is one more non maskable mode than there are maskable ones exposed in the API (and the control panel override allows support of plenty of other non maskable modes).

The MASK mentionned above is set via the following renderstate :
D3DRS_MULTISAMPLEMASK
There is one bit for each explicit sample.

The uses would be for semi-transparency (though it's probably better to use the alpha to coverage extension instead), or accumulation effects (motion blur, or other).

LeGreg
Thanks LeGreg!!
--== discman1028 ==--

This topic is closed to new replies.

Advertisement