Advertisement

FXAA Help

Started by August 30, 2011 07:48 PM
27 comments, last by EsorU 13 years, 1 month ago
I have the FXAA shader but it's so convolouted. Looked for a tutorial online but nothing turned up.


Anyone know where I can find documentation on FXAA and it's implememtation?
Hrmmm...

Download the shader from the website http://timothylottes.blogspot.com/

The FXAA shader only needs your color buffer as input, but this means you need an extra render target.

So, create an extra render target the same size as your backbuffer.
the FXAA pass should be after all of your game drawing and effects are done.
Copy the color buffer to a temp buffer.
Then, use the copied buffer as input to create the final image.

I am not sure which part you are having a difficult time with.
As for the shader itself, it contains many different implementations for Playstatio, XBox and PC versions. Read the comments, you can safely remove the unneeded code, which will improve your compile times.
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.
Advertisement


I am not sure which part you are having a difficult time with.



The download is a "h" file (header) with tons of macro's (defines). I only need it for the PC. My existing shaders are all FX files and for this specific application (not a game) that requires the AA, it is not written in C++.

Prior to the new requirements, hardware multisampling was sufficient but now they want to take screenshots. I was unable to provide multisampling when rendering to a surface for screen shots- hence, I need an AA alternative.

Will FXAA work with PS v2.0?

Does FXAA access require C++ implementation?

How does FXAA hold up on non- nvidia hardware?

These are the things I'm having a difficult time with...






To add to this, I'm also finding it difficult to create a full screen triangle. How can a triangle be full screen when my backbuffer and monitor are rectangular in shape?
Is it possible to use a sprite and pass that in?
My shader fails after adding the line:#include "Fxaa3_11.h"

IS FXAA SM 2.0 Compatible?




Advertisement

To add to this, I'm also finding it difficult to create a full screen triangle. How can a triangle be full screen when my backbuffer and monitor are rectangular in shape?

The way to do this is to create a triangle that is big enough so that the rectangle of the backbuffer fits inside. You can also use a full screen quad, if it is easier for you.



[color="#1C2837"]My shader fails after adding the line:#include "Fxaa3_11.h"
IS FXAA SM 2.0 Compatible?

I think it is. Did you put [font="Courier New"]#define FXAA_PC 1[/font] before the include?

Did you put [font="Courier New"]#define FXAA_PC 1[/font] before the include?



Yes, at the top of my shader I put the following:
#define FXAA_PC 1

#include "Fxaa3_11.h"



and it fails to compile. If I only add the include or only the define, then it compiles but with both of them it fails.
Do you have a way to tell why it fails to compile? Looking at the error message of the compiler e.g.

[quote name='smasherprog' timestamp='1314736896' post='4855616']
I am not sure which part you are having a difficult time with.



The download is a "h" file (header) with tons of macro's (defines). I only need it for the PC. My existing shaders are all FX files and for this specific application (not a game) that requires the AA, it is not written in C++.

Prior to the new requirements, hardware multisampling was sufficient but now they want to take screenshots. I was unable to provide multisampling when rendering to a surface for screen shots- hence, I need an AA alternative.

Will FXAA work with PS v2.0?

Does FXAA access require C++ implementation?

How does FXAA hold up on non- nvidia hardware?

These are the things I'm having a difficult time with...

[/quote]

FXAA works great, even on non NV hw. We used it in our commercial project, and this was a concern for us as well. Turns out it was not a problem.
FXAA requires no c++ side implementation, other than a full screen pass. (draw fullscreen quad, set shader, pass in main RT, output to backbuffer or RT of choice).
I don't remember any problems with FXAA on sm2, other than we had to disable the higher quality versions as it resulted in more instructions than supported by sm2. (Memory is a bit hazy though, so don't take my word for it).

This topic is closed to new replies.

Advertisement