Originally posted by zeoverlordl:
In the future i think simple 2x2 and 4x4 super sampling will be the dominant AA system when the GPU processing
But is not multisample AA faster? I think supersampling is really expensive! The point of multisample is that only processes the pixels in the borders and supersampling processes simply all the pixels.
Originally posted by Korval:
Why would you need a shader (ie: program) for that? Why not simply a few configuration options?
Well perhaps you’re right, but I think a small program for that could be more flexible and to be prepared for future things.
Let’s concrete a few more. See this:
[http://www.xbitlabs.com/articles/video/display/nv40_12.html](http://www.xbitlabs.com/articles/video/display/nv40_12.html)
You could be able to touch the sampling weights and to rotate the grid.
Also you should able to control how is done the trasparency antialiasing.
So the shader could be something like:
float4 main ( uniform int2 pixelXY )
{
//Perform an average of 4 samples near and multiply it using the pixel depth ( I know, it's stupid but is only a small example )
float4 topLeft = getPixel(pixelXY+int2(-1,-1));
float topLeftD = getDepth(pixelXY+int2(-1,-1));
float4 topRight = getPixel(pixelXY+int2(-1,1));
float4 topRightD = getDepth(pixelXY+int2(-1,1));
float4 botLeft = getPixel(pixelXY+int2(1,-1));
float4 botLeftD = getDepth(pixelXY+int2(1,-1));
float4 botRight = getPixel(pixelXY+int2(1,1));
float4 botRightD = getDepth(pixelXY+int2(1,1));
return (topRight*topRightD+botLeft*botLeftD*botRight*botRightD+topLeft*topLeftD)/4;
}
So with this you will have access to stencil, depth and pixels for antialasing ( or other things ). Basically it could have three instructions:
getPixel -> Retrieves the color of the pixel XY in the framebuffer
getDepth -> Retrieves the depth of the pixel XY in the framebuffer
getStencil -> Retrieves the stencil value of the pixelXY in the framebuffer
Using an option the GPU will fire our AA shader only for triangle borders ( multisampling ) or for ALL pixels ( for supersampling or post-pass effects, etc )
Well, I think more control over AA will be always welcome.