nVidia's FXAA mode (anti-aliasing)

Discussion in 'Videocards - NVIDIA GeForce Drivers Section' started by TheHunter, Jul 20, 2011.

  1. BetA

    BetA Ancient Guru

    Messages:
    4,526
    Likes Received:
    479
    GPU:
    G1-GTX980@1400Mhz
     
  2. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    Good news everyone!
    Version 0.3 beta

    I think everything works now.
    LumaSharpen sharpens in linear space now instead of gamma space because SMAA uses linear space and I didn't bother to correct for it.
    This means the sharpening now looks different, but I haven't yet figured out if it's better or worse or just different. Need to do some more testing.

    LumaSharpen currently sharpens the edges processed by SMAA and it looks OK but I'm not sure whether or not I should even sharpen the antialiased edges. I may decide to simply leave them be and have really smooth (but not sharp) edges and just let LumaSharpen bring out the detail in the textures.

    I also think HDR and Bloom works OK, but I need to do more testing on them.

    There is also a new feature - Presets.
    If you open the preset.h file you can choose which settings file to use.

    The default is settings.h but you can make a copy of your settings.h file, name it something else and point preset.h to it instead.

    This allows people to save their different favorite settings and more easily exchange them with each other.

    For example I could make some good Skyrim settings that I liked and copy my settings.h and name the new copy "CeeJays awesome Skyrim settings.h" and change preset.h to point to it.

    I could then share it with my friends and they could just copy the file to the right folder and change their preset.h file without messing with their own favorite settings.

    I still haven't decided on a better name - some ideas are :

    SweetFX
    SweetShader
    SweetShaderFX
    SweetSuite (just kidding)
    ShaderSuite
    ShaderFXSuite
    CustomFX
    CustomShaderFX

    What are your thoughts?
     
    Last edited: Aug 6, 2012
  3. Bat_Zonko

    Bat_Zonko Guest

    Messages:
    87
    Likes Received:
    0
    GPU:
    Sapphire 7950 OC
    Awesome. Just tried it out in Divinity 2 DKS and did some comparisions to my FXAA Injector settings (copied over my Luma and Tonemap settings).

    Looks real good. The SMAA does a bit better job at handling contrast/dark-levels then the FXAA does (in not losing any texture quality in those areas), so that is where I noticed the difference. Beyond that, runs the same and looks great.

    This is exactly what the SMAA injector was missing. It handles AA in some games better then FXAA (and vice-versa), but I hated losing the added benefit of the Luma Sharpen (which is a real God send for image quality) and the tonemapping.

    I'm as happy as a little girl right now! (Dieter voice for any old SNL fans) Add this to finally getting downsampling to work correctly on my AMD card, and I am very satisfied.

    As for the naming, I would suggest you at least use your handle as a Prefix. Something that has CeeJayDK on it. Like CeeJayDK_Luma-SMAA or something. But, more snazzy and less boring :) CeeJayDK_GamersSexWax might work.

    Bats
     
  4. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    I'm currently leaning towards CeeJays SweetFX Shader Suite , or just SweetFX for short.

    SweetFX is a play on words - it's a suite of shaders.
     

  5. TFL Replica

    TFL Replica Guest

    Messages:
    387
    Likes Received:
    5
    GPU:
    RTX 3060 Ti
    SweetFX sounds good.
     
  6. tsunami231

    tsunami231 Ancient Guru

    Messages:
    14,725
    Likes Received:
    1,854
    GPU:
    EVGA 1070Ti Black
    out of curiously when nvidia say FXAA HQ are they referring to there built in FXAA in there nvCP?
     
  7. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    Here is InjectSMAAmod Version 0.3

    Changelog:
    "..simplifies the installation, by making d3d9.dll and dxgi.dll load different .fx files so they can coexist in the same directory.
    You no longer need to find out what DirectX version you need to use, just copy the all files and the game will load the correct one."

    The next release of what I'm now calling CeeJays SweetFX Shader Suite will also include this improvement.
     
  8. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    I think so.
    Their driver FXAA has a few tweaks to make it easier on text according to Timothy Lottes blog.
     
  9. TFL Replica

    TFL Replica Guest

    Messages:
    387
    Likes Received:
    5
    GPU:
    RTX 3060 Ti
    Nvidia's way of taking screenshots with driver FXAA is to run the game in windowed mode. For some, that's just unacceptable.
     
  10. meds

    meds Guest

    Messages:
    385
    Likes Received:
    2
    GPU:
    .
    I hate FXAA as it makes textures far worse and most games already have lousy textures thanks to the console market not moving to the PS4/X720.
     

  11. yosef019

    yosef019 Ancient Guru

    Messages:
    2,186
    Likes Received:
    17
    GPU:
    EVGA 1080 ti
    what beter this or this with shaderfx 0.3beta
     
  12. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    ShaderFX (to be named SweetFx in the next release) is InjectSMAAmod + additional optional effects.

    So SweetFX is better if you want additional effects.

    I personally play with SMAA and LumaSharpen turned on, because this gives me smooth edges and sharper details.
    I don't normally use tonemapping, technicolor etc that much because it takes time to tweak a games colors to perfection and I spend my time divided between work, gaming and development on SweetFX, but I know that others use these options for manipulating the colors a lot.
     
  13. draegunstrife

    draegunstrife Active Member

    Messages:
    66
    Likes Received:
    0
    GPU:
    EVGA 780 Classified
    hehehe

    Waitin on that Sweetfx

    how far along is it?
     
  14. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    Well the beta that is out now is working for dx9 - use that.

    The next beta will add the ability to turn SMAA off, though right now I'm puzzled that turning it off doesn't seem to return the performance to the levels that I saw with the separate LumaSharpen mod.

    I'm guessing that the SMAA injector still does all the texture work required for SMAA to work, and there is no way to turn that off.

    I may decide to do another version based on the simpler FXAA injector because it will run faster if you don't want anti-aliasing (or if you want FXAA antialiasing)

    But before that, I think I'll port SweetFX to DX10 and call it SweetFX 1.0 - then rest, and try to improve on the shaders included and perhaps add a few more.

    I want to try a curve function for limiting the strength of lumasharpen based on how strong the contrast the surrounding pixels are and limit the sharpening for pixels that already have a lot of contrast to avoid oversharpening those areas. It should also help reduce halo artifacts.

    I also want to try basing the sharpening on a median of the surrounding pixels rather than a weighted average as I do now, because it should make the sharpening more subtle and should avoid halo artifacts. It might be slow though - doing a median on the values is a lot more work than just taking the average, but I think I can keep it fast enough with a few tricks.

    The vignette needs improvement and I want to study how a real vignette looks on shots from movie and photo cameras, and also make it possible to do more types of vignettes than just an oval darkening border around the image.

    I also want to do dithering, of both the vignette (because it currently adds banding artifacts) and maybe even of the entire image.
     
    Last edited: Aug 16, 2012
  15. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    I'm still working on porting SweetFX to DX10, but here is SweetFX 0.4 beta for DX9

    SMAA can now be turned off, but as I said before you don't gain as much performance from this as I had hoped because the injector still does most of the work required for SMAA.

    I have reworked the vignette so it's effect is now circular instead of an oval that depended on your screen resolution. Previously if you f.x had a screen with a 16:9 width to height ratio, then the vignette had a 16:9 ratio too. Now it always has a 1:1 ratio so it's circular and not oval.
    Real vignettes from camera lenses are circular because lenses are circular - no matter what format your sensor or film uses. The vignette shader now mimics that.
    I may put oval and other shapes of vignettes back in later with a setting so you can choose which shape you want, but for now it's circular.

    I have also tweaked it to have a steeper fall-off so the middle of the screen stays less affected and then the effect increases faster the nearer it gets to the edge.
    This looks better IMO and has the nice side-effect of making the banding artifacts much less noticeable.

    I made other minor changes to the code of SweetFX but none that should affect how the effects work.

    For example the settings files are now in the same directory as the game exe and the injector dlls, because I found it to be more work to start a game in one directory and then go to another directory and tweak the settings.
    Normally this would not be a problem because most people I think just set the settings they like once per game and then play it, but I constantly make small changes to the code and the settings when I'm developing and so changing between directories all the time was annoying.

    That port to DX10 is going OK, but I can't say when it will be done.
    I have also tried to make the anti-aliased edges stay smoother when I enable lumasharpen, but so far I'm finding it tricky. I have ideas for some different approaches I could try though, so it's not like I'm stuck.
     
    Last edited: Aug 17, 2012

  16. -Tj-

    -Tj- Ancient Guru

    Messages:
    18,097
    Likes Received:
    2,603
    GPU:
    3080TI iChill Black
    I tried new SMAA 2.7
    http://www.iryoku.com/smaa/#downloads

    hooked it up with old smaa injector 1.2 and yes it works, but IQ can be a bit so so.. I tested in monster Hunter frontier benchmark - main menu and its mostly by letters (fuzzy fonts).. default SMAA 1.2 injector showed it normally.. Idk im thinking its luma/green alpha issue.


    Could you CeeJay.Dk check what could be the issue? :) Im not so familiar with those math paragraphs

    http://www.mediafire.com/file/2qptjj22hbac9d5/SMAA_2.7.7z
     
  17. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    The issue is that you're not using the textures that 2.7 needs, but are using the textures meant for 2.6.

    You can't change the textures though, because they are not external files but are built into the injector dll. So without source code, they cannot be changed (well maybe if you can disassemble the dll - I can't).

    But 2.7 is not the SMAA update you're looking for , move along..
    This is because the update to 2.7 added S2x and 4x support, and neither of these modes can be used with the injector - they require application/game support.

    AFAIK there were no other changes or improvements.
     
  18. Pill Monster

    Pill Monster Banned

    Messages:
    25,211
    Likes Received:
    9
    GPU:
    7950 Vapor-X 1100/1500
    So what should I use if the game doesn't support S2x and 4x (whatever they are). Any ideas?

    I play FO:NV, Shogun II, Mass Effect. Skyrim etc etc
     
  19. -Tj-

    -Tj- Ancient Guru

    Messages:
    18,097
    Likes Received:
    2,603
    GPU:
    3080TI iChill Black
    ^
    Well not with "my combined injection tool", it will act the same as SMAA 1.2 with basic SMAA technique, sometimes it may cause small anomalies - fuzzy text. Although ingame looked fine, in fact it was a bit more anti aliased compared to 1.2 :nerd:

    I tested both in Monster Hunter Frontier 3 benchmark - I was comparing distant mountains aliasing (at the beginning).

    I see, yeah I kinda knew its gonna be something like that.

    lol the moment I merged the files I thought, so where can I activate this 2x, 4x thingy.. *moves along* :grin:


    Thanks for explaining :)
     
    Last edited: Aug 17, 2012
  20. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    I'll explain.
    SMAA has 4 modes it can be used in:

    1x, T2x, S2x and 4x

    1x is the fastest but lowest quality version and 4x is the highest. T2x and S2x are about the same qualitywise, but T2x is much faster than S2x.

    They are named after how many samples they use and how they acquire them.

    1x takes 1 sample per pixel, from the center of the pixel - this is the version the injector uses.

    T2x takes 2 "temporal" samples - 1 sample per pixel for each frame, but it uses the sample from the previous frame and every frame it moves the sample slightly off-center and then it corrects for movement and blends the two temporal samples into one so you get twice the resolution but still only take 1 sample per frame. Very clever. Takes about 130% of the time that 1x takes, but has twice the resolution.

    S2x takes 2 "spatial" samples - 2 samples each frame, both samples moved slightly off-center and blended, but it doesn't use information from the previous frame as T2x does. Takes twice the samples each frame so it takes about 200% of the time 1x takes, but has twice the resolution.

    4x combines T2x and S2x, and takes 2 spatial samples each frame and uses the information from the previous frame too, to give 4x the resolution in about 230% of the time 1x takes.

    T2X, S2x and 4x are all awesome, but require the application to support them, otherwise it can't move the samples or provide the velocity vectors needed to correct for motion blur.

    The injector can only use the image of the scene as the game rendered it - it cannot move the samples and it cannot read the velocity vectors that tells it how the new image have moved in relation to the previous and so the only mode that will work with the injector is SMAA 1x.

    Hopefully more games will implement SMAA T2x, S2x and 4x in the future.

    Read the SMAA documentation, whitepapers and see the video to learn more about the difference between the different SMAA modes.
     

Share This Page