hey,
Recentley I was working on a project with SSAO and I noticed how much aliasing the scene accumalated due to the lack of full screen Antialiasing. I opened up a new .fx file and began working...
The result: Full Screen Antialiasing for render targets!
This shader file can be included in any HLSL shader and contains a few useful functions for creating "fake" but quality antialiasing. In fact, when set to a high level of antialiasing, this can look even better than the hardware's!
When sampling a single pixel, you can use the tex2DAA(sampler samplemap, float2 texCoord) to call the basic fragment shader.
Basically, the fragment shader (function) samples a few points around the input coordinates and compares the result to the acual point. If the result is very different from the actual sample, the function returns a weighted average; otherwise it returns the true value. This allows the function to only blur the edges of polygons and very harsh pixel discontinuities to prevent the scene from becoming blury.
you can also set the following global variables to control the filtering.
int FSAA_FILTER
Filter kernal. You can choose Linear(0)(default),Bilinear(1),Anisotropic(2),Gaussian(3),or Radial(4) scene filtering!
int FSAA_MIN
Minimum level of antialiasing to be preformed per pixel. 0 means that the filter is allowed to skip parts of the scene that are estimated to not need antialiasing. 1 or higher garuntees antialiasing on all pixels. The higher the number, the more samples are minimally taken. Default = 0
int FSAA_MAX
Maximum level of antialiasing. filter samples will not exceed this number (this means 0 basically turns off FSAA). Default = 5;
float FSAA_REF
Sets the offset constant used for determining the weight of a sampled pixel. range: 0.000 to 3.000 default(0.25)
boolean FSAA_ENABLED
if true, FSAA is enabled. default(false)
boolean FSAA_MULTISAMPLE
if true, FSAA multi sampling is enabled. This can really slow down frame rate but has remarkable preformance. This is an advanced filter and only works with shaders in PS_2_0 or higher.
http://www.groundtacticsgame.com/Alienware m17x R Custom laptop
specs:
Intel Core 2 Extreme Quad CPU Q9300
2x Nvidia 280GTX 2GB vram
6GB ddr3 memory@ 1333Mhz
512GB SSD
1200p 17' screen
runs Crysis Warhead on max settings at 1200p at 90 fps