This might prove useful to someone. This is an XNA implementation of Timothy Lottes’ FXAA algorithm.
I’d tried it a while back (perhaps before he released his final version), and was never able to get good results – aesthetically or performance-wise.
I’m not sure what was different this time, but it really is nearly a “drop in” component. It took less than an hour to get it up and running on the PC and Xbox, and maybe 15 minutes to put it in my game. It looks good and is fast.
The default “quality” preset costs about 1.5ms on my GeForce GT 240, and the console version costs about 1ms on the Xbox 360.
I haven’t really played around with tweaking the values – I’ve just left everything at the suggested defaults. I’m using “green as luminance” for simplicity.
The only changes required were for the Xbox. XNA doesn’t support texture samplers with an exponent bias (as far as I can tell), so a small change needs to be made to the shader that adds a few divisions by constant values. Minor perf impact.
Here are two examples without FXAA (on the left) and with FXAA (on the right).