I’m using this example project’s XNA 4.0 form control in an application I’m writing: http://creators.xna.com/en-US/sample/winforms_series1
If you are unfamiliar with FXAA, check out the creator’s site:
http://timothylottes.blogspot.com/2011/03/nvidia-fxaa.html
I’ve spent quite a bit of time so far trying to figure out to use it without any luck (so far…). It’s true I don’t have much experience at all with graphics programming, but I do currently have a nice application running, it just looks really really poor with the jagged lines. I know about the built-in method for AA, but doesn’t work for me and my laptop computer. So my request is about using FXAA and not the built-in methods.
At this point:
I have FXAA 3.11 header file in my Content project.
I have a generic FX file generated by visual studio with a few things like:
#define FXAA_PC_CONSOLE 1
#define FXAA_HLSL_5 1
#define FXAA_QUALITY__PRESET 12
#include "Includes/Fxaa3_11.h"
I’m just asking here to see if anyone could provide some XNA 4.0 examples, specifically with using that custom windows forms method.
I appreciate any help someone might be able to provide.
Edit 3:
I’ve been trying to work out how to get FXAA working since I posted this message.
I found this:
http://www.gamedev.net/topic/609638-fxaa-help/page__st__20
and this:
http://fxaa-pp-inject.assembla.me/trunk/DirectX9/shader.fx
I striped down FXAA to bare bones FXAA_PC_CONSOLE type and it compiles. I just need to figure out the parameter fxaaConsolePosPos that is the top left and bottom right position of each pixel. Anyways, it looks like FXAA_PC_CONSOLE might work with shader model 2.0 that I need to use with REACH and winforms based XNA.
So I figured it out, at least using the lesser version of FXAA designed for consoles and low-end PCs. I can’t guarantee my parameters to the shader code are correct, but I do see a noticeable difference when it is running.
Here is the complete solution with my chopped up shader and pieces of the C# XNA 4.0 code:
The shader code first (put that in a .fx file in your Content sub-project):
note that I replaced tex2Dlod with tex2D as per a suggestion that SM2.0 doesn’t support the first type
Here is a snippet of C-sharp code to apply the shader: