Heya folks,
I posted this over at the steam forums, also being part of of the below mentioned thread (all props to "some dude" who came up with this solution, and also BeetleatWar1977 working on direct shader implementation in general and last but not least Timothy Lottes at Nvidia for giving us FXAA in the first place, I was merely pushing and analyzing on topic, cross referencing known stuff and issues to gain the needed attention and get the real smart folks together to get it going) and just thought this might be nice for a lot of ppl especially if you already suffer from performance issues with warband (or at least running cRPG) and maybe also in other games but still would like to use some form of AA. So here it goes:
just wanted to let you know about this awesome stuff,
keep in mind tho it
might cause troubles in Steam/VAC/ punkbuster/ GFWL
anti cheat enabled Games (as
false positives, so could in that case get one banned or even make your babies cry), so maybe stay away from those for now (not the babies tho).
Confirmed to work in a lot of DX9 and now even in some DX10/ 11 games.
You have no idea what this actually does? read this:Performance/ Quality trade off is quite good (especially compared to more traditional power hungry
antialiasing methods moreso on systems which can't handle those very well without performance issues).
If you come across any issues/ bugs,
please report them in this thread as detailed as possible (so post your system specs, a description of the issue and upload some screenhots).
Hi, I'm some dude and just wanted to see how fxaa looks on my notebook. But oh noes, I have only two old games and both use d3d9.
So instead of complaining I wrote some code and play those games with fxaa
now. It's faster than with the aa provided by the games.
@some dude
thx for providing your work on fxaa injection, basically we were (well it's really all User BeetleatWar1977, props to him) trying to figure out how to make it work with games based on an UE3 Engine for starters (partly because of the freely accessible shaders, I brought up the topic because I had noticed some time ago that really most compatibility AA bit modes remove/ disable some ingame effects/ shaders so if FXAA would be useable that wouldn't be an issue anymore and maybe combined with higher res downsampling be almost as "perfect" as it could get).
While I lack the background to do much with it (shader code/ing), it's good some ppl do know a thing or two about it but it also seems to need ppl asking the right questions and/ or getting some attention of those who can actually figure this out, really took me by surprise this potential seemed largely undiscovered/ gone unnoticed, not just on the topic of FXAA but shaders tweaking in general, with so many enthusiast and talented game modders/ devs around. That's kinda my part so far, pushing for it and asking questions for some really smart ppl to figure it out. A few pages back I posted what Timothy Lottes from Nvidia answered to a quick question about FXAA injection, while he kept it short he described a quick and dirty implementation. Not sure if it might be of any use to you as you and BeetleatWar1977 might have already surpassed this from the looks of it but it'd be cool if you'd stay around!
Timothy Lottes said...
"might be possible to quickly prototype FXAA in a GL or DX11 game which provides editable shaders. You would need to find a late-in the-frame post processing shader which samples each pixel once, then run FXAA to "sample the pixel" with FXAA_GREEN_AS_LUMA and use in-pixel-shader texture size queries to produce the required inputs to FXAA (so DX9 is likely out). This would NOT be the correct way to integrate FXAA, but might work."
-----
http://www.forum-3dcenter.org/vbulletin/showthread.php?p=8869098#post8869098While this is a German forum (all is also explained in english) english speaking guests are greatly welcome (no registration necessary to post on this part of the forums).
Give it a try it's really sweet.
But please keep this in mind besides the fact that it is work in progress on a lot of ends:
Without FXAA's Pixel and Sub-Pixel Contrast Reduction, visually aliasing still remains. With FXAA, aliasing is much reduced and consistent across image features. No post-process AA filter is going to fix everything, there is always a compromise between sharpness and lack of aliasing, but I feel as if FXAA does a good job and has a great quality/cost ratio.
Certainly some developers and users will have different preferences on the aliasing vs softness trade-off. For this FXAA 3.9 Quality algorithm has a tuning knob: FXAA_QUALITY__SUBPIX. The "No Contrast Reduction" images were produced by zeroing this tuning knob.
-----
04 August 2011 - Beta 8 of the hook:
[some dude] Minor changes in d3d9 mode, no changes in d3d10 (due to no bugreports with small demos and my lack of d3d11 hardware). Additionally I gave Anarki_Hunter's suggestion some attention. Beta 7 gives you the possibility to add a sharpening pass [you don't have to bother with this at all for now- delu] in DirectX 9 prior to fxaa execution. The readme contains how.
[some dude]
Sorry guys, I tried to consider all the different game engines I encountered so far and sometimes a new version creates and breaks compatibilities at the same time. [talking about the 1 pack for 3 renderpath hook approach for lots of games]
However, I think to have found a good solution for the "darkness" problem which also fixes Crysis 1 -dx9 (Thanks Ronny145). From how I expect GTA4's engine to work, it also may fix the lights.
http://www.forum-3dcenter.org/vbulletin/showthread.php?p=8869098#post8869098
Don't expect much from the sharpening pass. I just took some random sharpen shader and did not tune any parameters. You can experiment with own sharpening shaders if you can work with hlsl. Let me know if there is a good one.
beta version 8 notes
beta version 8! directx 9, directx 10, directx 11, x86 binaries only! may be incompatible with any other form of antialiasing! can be combined with downsampling!
Install:
If the game uses DirectX 9, put all files from the d3d9 directory into the directory containing the game executable.
If the game uses DirectX 10/11, put all files from the d3d10 directory into the directory containing the game executable.
Uninstall: Remove the files.
Notes:
Do not mix d3d9 and d3d10 the files.
Install the latest DirectX runtime.
A "log.log" file is created to log behaviour/ bugs.
If the "log.log" file is not created then you use the wrong "*.dll" or you put it into the wrong directory.
If the "log.log" is created but the game crashes or FXAA is disabled, look where the "log.log" is created. Usually the shader files go into that particular directory.
Try to put the files into different directories before saying it doesn't work.
In some games (e.g. Portal 1 or Halo 1) refuse to accept the alpha channel. A general workaround (lower quality) for those is to add the following line at the beginning of shader.fx :
#define FXAA_GREEN_AS_LUMA 1
There is a way to experiment with sharpening. I added an example. To activate additional sharpening filter change edit the line "//Replace this line with #include "Sharpen.h" to add a sharpening pass" in shader.fx.
Note that right now sharpening is only an example that it can be done. I more-or-less copypasted a random sharpen filter to show how my mod can be modded.
Keys:
Insert : Enable/Disable FXAA
Del : Screenshot