多重採樣抗鋸齒(MultiSampling Anti-Aliasing,簡稱MSAA)是一種特殊的超級採樣抗鋸齒(SSAA)。MSAA首先來自於OpenGL。具體是MSAA只對Z緩存(Z-Buffer)和模板緩存(Stencil Buffer)中的數據進行超級採樣抗鋸齒的處理。能夠簡單理解爲只對多邊形的邊緣進行抗鋸齒處理。這樣的話,相比SSAA對畫面中全部數據進行處理,MSAA對資源的消耗需求大幅減少,不過在畫質上可能稍有不如SSAA。html
http://www.cnblogs.com/mikewolf2002/archive/2012/11/24/2785441.htmlwindows
http://en.wikipedia.org/wiki/Alpha_to_coverage緩存
EQAAapp
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch04.htmlless
to be continued....ide
Alpha_to_coverage性能
This technique uses the alpha channel of textures as a coverage mask for anti-aliasing.this
Alpha to coverage multisampling is based on regular multisampling, except that the alpha coverage mask is ANDed with the multisample mask. Alpha-to-coverage converts the alpha component output from the pixel shader to a coverage mask. When the multisampling is applied each output fragment gets a transparency of 0 or 1 depending on alpha coverage and the multisamplingresult.spa
alphatocoverage 採樣技術是基於常規的採樣技術,除了alpha coverage mask是和採樣mask進行與(and)運算。atc把alpha份量從ps輸出到coverage mask。多重採樣依據這個alpha coverage 與 多重採樣的結果 .net
alpha 被當作mask 管線中會根據alpha的mask來採樣
這樣明顯沒法同時實現一個透明功能和 mask功能
Unlike alpha blending, alpha to coverage is order independent, so leaves and fronds do not need to be sorted by depth to achieve a correct image.
Alpha-to-coverage is a multisampling technique that is most useful for situations such as dense foliage where there are several overlapping polygons that use alpha transparency to define edges within the surface.
You can use the AlphaToCoverageEnable member of D3D11_BLEND_DESC1 or D3D11_BLEND_DESC to toggle whether the runtime converts the .a component (alpha) of output register SV_Target0 from the pixel shader to an n-step coverage mask (given an n-sample RenderTarget). The runtime performs an AND operation of this mask with the typical sample coverage for the pixel in the primitive (in addition to the sample mask) to determine which samples to update in all the active RenderTargets.
If the pixel shader outputs SV_Coverage, the runtime disables alpha-to-coverage.
Note In multisampling, the runtime shares only one coverage for all RenderTargets. The fact that the runtime reads and converts .a from output SV_Target0 to coverage when AlphaToCoverageEnable is TRUE does not change the .a value that goes to the blender at RenderTarget 0 (if a RenderTarget happens to be set there). In general, if you enable alpha-to-coverage, you don't affect how all color outputs from pixel shaders interact with RenderTargets through the output-merger stage except that the runtime performs an AND operation of the coverage mask with the alpha-to-coverage mask. Alpha-to-coverage works independently to whether the runtime can blend RenderTarget or whether you use blending onRenderTarget.
Graphics hardware doesn't precisely specify exactly how it converts pixel shader SV_Target0.a (alpha) to a coverage mask, except that alpha of 0 (or less) must map to no coverage and alpha of 1 (or greater) must map to full coverage (before the runtime performs an AND operation with actual primitive coverage). As alpha goes from 0 to 1, the resulting coverage should generally increase monotonically. However, hardware might perform area dithering to provide some better quantization of alpha values at the cost of spatial resolution and noise. An alpha value of NaN (Not a Number) results in a no coverage (zero) mask.
Alpha-to-coverage is also traditionally used for screen-door transparency or defining detailed silhouettes for otherwise opaque sprites.
alphatocoverage 和alpha blend是獨立的
http://msdn.microsoft.com/ZH-CN/library/windows/desktop/bb205072(v=vs.85).aspx#Alpha_To_Coverage
---------------------------
ccording to the OpenGL GL_ARB_multisample specification
http://en.wikipedia.org/wiki/Multisample_anti-aliasing
--------------------------------------
gl 實現 msaa --FBO
http://blog.csdn.net/xiajun07061225/article/details/7690805
--------------------
http://www.cnblogs.com/mikewolf2002/archive/2012/11/24/2785441.html
coverage aa
http://www.cnblogs.com/mikewolf2002/archive/2012/11/22/2783235.html
http://www.cnblogs.com/gongminmin/archive/2011/05/16/2047506.html
如圖1的狀況,沒有centric插值的話,藍色三角形的兩個採樣點將都獲得純藍的顏色(外差而得),最終像素的顏色就是(2 * (0, 0, 1) + 14 * (1, 1, 0)) / 16 = (0.875, 0.875, 0.125)。有centric插值的話就是個更正確的淺藍色((1, 1, 1) + (0.77, 0.77, 1)) / 2 = (0.885, 0.885, 1),最終像素顏色是(2 * (0.885, 0.885, 1) + 14 * (1, 1, 0)) / 16= (0.98, 0.98, 0.125)。以下圖所示:
性能統計:每一個像素裏PS執行次數爲每一個覆蓋到該像素的三角形一次,佔用空間N個color + N個depth。
---
這段看了不少遍才懂,結合mike
有centric的狀況下
藍色三角形在這個pix算一次 ps ((1, 1, 1) + (0.77, 0.77, 1)) / 2 = (0.885, 0.885, 1)
黃色三角形在這pix算一次ps (1, 1, 0)
二者加權平均