Jump to content
  • Advertisement
Sign in to follow this  
DJTN

FXAA Help

This topic is 2464 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites


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...






Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
My shader fails after adding the line:#include "Fxaa3_11.h"

IS FXAA SM 2.0 Compatible?




Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
Do you have a way to tell why it fails to compile? Looking at the error message of the compiler e.g.

Share this post


Link to post
Share on other sites

[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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!