From the last deferred MSAA thread, I'm thinking a method with less memory requirenment, faster rendering, and orthogonal to MRT. It's very difficult to me, fortunately, there may be some progress. This time, the edge-AA does not need any extra framebuffer, nor does it use hardware MSAA unit, and runs faster than hardware 4x MSAA on my system, with acceptable quality. (at least not worse.. ) but still, it has to do some pre-process. if you have a better way, plz let me know.
this is what I did to get edge-AA work:
1: pre-process the anti-aliasing geomerty, similar to shadow volume's.
2: render the scene, with AA off.
3: StretchRect the back buffer to a texture, use it, with Bilinear filter.
3: render the edge, with the following shader:
VS:
1: check if the edge is on the silhouette, else throw it away.
2: calculate the perpendicular direction of the edge, outwards the triangle.
PS:
1: dont use SM3.0 vPos as it's interger. I need frac() so calculate it.
2: the pixel coverage comes from the frac(vPos).
3: sample the scene using the offset and bilinear filtering.
the demo goes here, play
http://gamesir.enorth.com.cn/AttachFile-336674
this is what I did to get edge-AA work:
1: pre-process the anti-aliasing geomerty, similar to shadow volume's.
2: render the scene, with AA off.
3: StretchRect the back buffer to a texture, use it, with Bilinear filter.
3: render the edge, with the following shader:
VS:
1: check if the edge is on the silhouette, else throw it away.
2: calculate the perpendicular direction of the edge, outwards the triangle.
PS:
1: dont use SM3.0 vPos as it's interger. I need frac() so calculate it.
2: the pixel coverage comes from the frac(vPos).
3: sample the scene using the offset and bilinear filtering.
the demo goes here, play
http://gamesir.enorth.com.cn/AttachFile-336674