SweetFX Shader Suite release and discussion thread #3

Discussion in 'Games, Gaming & Game-demos' started by CeeJay.dk, Mar 18, 2013.

Thread Status:
Not open for further replies.
  1. Gerardius

    Gerardius New Member

    Messages:
    2
    Likes Received:
    0
    GPU:
    nVidia GTX 670 DCUII 2GB
    FSX great, Prepar3D hangs loading program

    Hi!

    I get stunning graphics and performance in Microsoft Flight Simulator X (FSX), but in Lockheed Martin Prepar3d, can't start because a Fatal error occurs.

    Any idea about get working this great tool in this simulator?

    Thanks and advance.

    Gerard
     
  2. master2k8

    master2k8 Active Member

    Messages:
    63
    Likes Received:
    0
    GPU:
    7950 1.1 Ghz Edition
    sweetfx without enabled shaders causes picture quality loss

    @ ceejay.dk maybe you take a look at it something must be wrong because some regions get blurred especially text in WoW gets bad readable by just enabled sweetfx without shaders (i used swfx 1.4)

    i also modified lumasharpen/ wrote a new (experimental) shader:

    http://jeschke-software.at/dls/LumaSharpen.h

    it does bilinear edge detection and should do sharpen and blur but i actually can't trust results because sweetfx enabled without shaders adds blur by itself somehow

    m2k
     
    Last edited: Apr 17, 2013
  3. Elajitz

    Elajitz Master Guru

    Messages:
    686
    Likes Received:
    24
    GPU:
    RTX 2080TI Ventus
    Edit K-Putt's Mass effect 3 Sfx settings!
    added carton and some more Sharpness
    and FXAA Instead if SMAA

    [​IMG]
    [​IMG]
    [​IMG]
     
    Last edited: Apr 17, 2013
  4. PhazeDelta1

    PhazeDelta1 Moderator Staff Member

    Messages:
    15,616
    Likes Received:
    13
    GPU:
    EVGA 1080 FTW
    Care to post your settings for that?
     

  5. Wanny

    Wanny Ancient Guru

    Messages:
    7,480
    Likes Received:
    1
    GPU:
    GTX 980 Ti GAMING 6G
    I would be careful with cartoon. It adds unnecessary aliasing to edges.
     
  6. Elajitz

    Elajitz Master Guru

    Messages:
    686
    Likes Received:
    24
    GPU:
    RTX 2080TI Ventus
    Last edited: Apr 18, 2013
  7. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Elajitz, your SMAA settings are insane. Anything over SMAA_MAX_SEARCH_STEPS 32 is madness. Settings that high are for dreamshots only, and not for playing.
    Try comparing SMAA_MAX_SEARCH_STEPS 98 to my default of SMAA_MAX_SEARCH_STEPS 16 and see if you can spot the difference. It's extremely hard, and it should be near impossible when comparing against SMAA_MAX_SEARCH_STEPS 32.

    Also when you activate cartoon you overwrite all the work SMAA did - effectively disabling SMAA, more or less. I suggest using other types of AA (in-game or through RadeonPro, or maybe downsampling) when using Cartoon. It probably best with downsampling as this should also help clean up the slightly noise look it gives.
     
  8. Elajitz

    Elajitz Master Guru

    Messages:
    686
    Likes Received:
    24
    GPU:
    RTX 2080TI Ventus
    Okay i will test and lower the smaa! or just disable it cuz i have aa in game enabled, and the built in FXAA in some games!.. BTW can i use downsampling whit a built in monitor in my laptop or do i need a Other monitor?
     
  9. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Are you running WoW in DX9 or DX10?

    If DX10 then the problem might be that SMAA does not disable under DX10 because I originally found writing a new vertex shader and techniques for it confusing and so left that bit out.
    This won't be the case in the next version though - I just rewrote the vertex shaders for both DX9 and DX10/11 (I needed them to support some new optimizations I have planned)
    It was easy too - I understand much more about vertex shader programming now than I initially did when I wrote the first version.

    BTW your code looks terribly unoptimized.
    You are not vectorizing most of your calculations - you are not exploiting bilinear filtering when you sample the texture - you are not using the dot() instruction when you could be (I love the dot() - it's so fast and versatile) and you are using very deep conditional branches (I counted 12 levels - I sure hope the compiler unrolls that or it will take a large performance hit)

    Also why are you using equal weights to calculate luma - wouldn't BT.709 weights be more appropriate ?

    Here are some good documents on writing optimized shaders:
    http://developer.amd.com/wordpress/media/2012/10/03_Clever_Shader_Tricks.pdf

    http://developer.amd.com/wordpress/media/2012/10/ATI_Radeon_HD_2000_programming_guide.pdf

    http://humus.name/index.php?page=Articles&ID=6
     
  10. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    If you could describe the error and post the log.log file that would be a good start.
    Also do you know if there is a demo of Prepar3d that I can download and try because without a way to run it, it will very hard to figure out.
     

  11. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    It should work AFAIK. There is a good downsampling thread elsewhere on this forum - the people there could probably help you if you have problems.
     
  12. Elajitz

    Elajitz Master Guru

    Messages:
    686
    Likes Received:
    24
    GPU:
    RTX 2080TI Ventus
    Okay Thx! I disabled SMAA and use In game AA/FXAA whit battlefield 3
    lower sharpening and Cartoon looks much better now :D
     
  13. master2k8

    master2k8 Active Member

    Messages:
    63
    Likes Received:
    0
    GPU:
    7950 1.1 Ghz Edition
    i agree that the shader is unoptimized ... for weights (sharpen) i used Input from a tutorial for creating an "Unsharp Mask" ( sharpen is created moving colors towards "black and white" / creating a gap ... the static vars are just for testing (better would be to calculate some sane values depended on the Input Pixel) and for bilinear Thing this was my own idea :)

    All the if cases describe the bilinear edge detection ...
    (like that)


    ####|#####
    ####|#####
    ####|#####
    - - - ORI - - -
    ####|#####
    ####|#####
    ####|#####

    (where "|" describes the Pixels compared).

    i also dont really would know how to it without if cases .. of course i could write everything in one line and can make it just one if case but for better readability i put it into 4 lines .. also it even improves Speed because if the first if case for example already Fails all other if cases are not executed that again save time. for blur i simple adapt the black/white values from the previous Pixel and the next Pixel (for x and y) and move it as Long as required towards this value (while keeping the color original).
    (the 2 while Loops seems to be the slowest in the code... im sure theres also a way to optimize that).

    But i must agree that theres of course still place for optimzing and also that i've the bad habbit to start calculating with single scalars from vectors (i also had that.. before i did anything to sweetfx i programmed some stuff in OpenGL.. and the results of my shaders where similar (smile).

    Also i have to say that shader is not already final for example
    edgedetectintensity should be seperate for sharpen and blur as Input value

    and beside optimization still other small things :) (notice i called it "Alpha") ;)

    for the WoW Thing i use directX11 and i thought something similar than you replied theres smaa still running in the Background (ive seen it on edges they are smoother (on textures) but it causes some ugly effect to the text somehow.


    add: now i could test my shader with dx9 (wow) and its working i set Offset bias to 5.0 :) nice so far i didnt even know if it was working or not

    i also updated it to just do sharpen because it corrupted Fonts in wow similar like smaa does... but its still unoptimized and still not final
    ( http://jeschke-software.at/dls/LumaSharpen1.h )
    i tried it with Offset bias 1.5 in wow and its working :) (at least it does) ^^


    best regards


    m2k
     
    Last edited: Apr 18, 2013
  14. K-putt

    K-putt Master Guru

    Messages:
    472
    Likes Received:
    0
    GPU:
    GTX 1080Ti
    Updated my Dishonored .cfg because of the recent DLC Knife of Dunwall.

    Apparently the developers changed a bit of the color grading in the game.
    Click here for the .cfg

    On
    [​IMG]
    Off
    [​IMG]

    [​IMG]
     
  15. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Some hints:

    Instead of
    Code:
    float4 nextpixel =  myTex2D(s0, tex + float2(px,0)*offset_bias);
    do
    Code:
    float3 nextpixel =  myTex2D(s0, tex + float2(px,0)*offset_bias).rgb;
    Doing calculations on only 3 scalar parts is faster than doing calculations on 4.

    Instead of
    [CODEfloat blackwhitenext = (nextpixel.r + nextpixel.g + nextpixel.b+0.00001)/3;[/CODE]
    do
    Code:
    float blackwhitenext = dot(nextpixel,CoefLuma);
    You can use whatever coefficients you'd like, but I prefer the BT.709 ones - if you prefer the equal weights then you can use those instead.

    And because the next thing you do to blackwhitenext is to add edgedetectintensity , then you could roll that into the dot too, and change the dot to this:

    Code:
    float blackwhitenext = dot(float4(nextpixel,1.0),float4(CoefLuma,edgedetectintensity));
    The ifs might be replaced by something like:
    Code:
    abs(blackwhitecurr - blackwhitenext)
    When blackwhitecurr is larger it will contain the difference and will evaluate to true if you test it, but when blackwhitenext is larger it will be 0 and evaluates to false.
    All the truth/false results could then be combined with dot()s and tested for.

    In the first case it's probably easier to reverse the truth/false condition :
    Code:
    float blackwhitenext_larger = abs(blackwhitenext-blackwhitecurr);
    then you can test up to 4 conditions with a single dot:
    Code:
    float first_four = dot(float4(blackwhitenext_larger,blackwhitenext2_larger,blackwhitenext3_larger,blackwhiteprev_larger),1.0);
    This way if any of these where true, then the final result was also true.
    Do the same for the other 8 and then combine the truth results again so you have a single result.

    If that is true then one of the other pixels were larger than the current and you then you would not do sharpening on that.

    Since the next set of ifs does the same only in reverse - it tests if blackwhitecurr is smaller than the other values, you could combine the two sets of test into one by instead doing :
    Code:
    float blackwhitenext_larger = abs(ceil(blackwhitenext-blackwhitecurr))
    It will result in 0 if blackwhitecurr is larger and 1 if blackwhitenext is larger.
    When you are done combining all the truth results you will then know that if the combined result == 0 then blackwhitecurr was larger than all of them and if the result was 12 then it was smaller than all of them.
    (and if was 7 then it was smaller than 7 of them and larger than 5 of them)

    Also dont do :

    Code:
    inputcolor.r +=0.00001+inputcolor.r/100.0*(6*sharpintensity);
    inputcolor.g +=0.00001+inputcolor.g/100.0*(6*sharpintensity);
    inputcolor.b +=0.00001+inputcolor.b/100.0*(6*sharpintensity);
    when you can do

    Code:
    inputcolor.rgb = inputcolor.rgb * (6 * sharpintensity * (1.0/100.0) + 1.0);
    There is no need to insert a small number to avoid dividing by 0 when you can just multiply by the reciprocal of the number you want to divide by.

    Also don't multiply a value by a constant multiplier and then add the result to the same value, when you can just multiply by the (multiplier + 1)

    WolframAlpha can be a great help with reducing the math of formulas and suggesting alternate forms that you could possible optimize better.

    I also strongly recommend using GPU ShaderAnalyzer to see the assembler code the hlsl code generates.

    I hope this helps and have given you some ideas.
     
    Last edited: Apr 18, 2013

  16. player

    player Member

    Messages:
    29
    Likes Received:
    0
    GPU:
    dv6
    yea i also think sharpening its alot in ur preset but i like the rest :)
    can u post the modified settings lowered sharpening ? thanks
     
  17. Elajitz

    Elajitz Master Guru

    Messages:
    686
    Likes Received:
    24
    GPU:
    RTX 2080TI Ventus
    Last edited: Apr 18, 2013
  18. marcosamerio

    marcosamerio Master Guru

    Messages:
    689
    Likes Received:
    1
    GPU:
    EVGA NVIDIA 680 GTX
    Hi all, ┬┐anyone knows how to put to work SweetFX 1.4 in Killing Floor using directx8?,

    i try puting all where the .exe is llocated but not work, or only SweetFX

    with dx 9,10 and 11.

    Bye
     
  19. Zomgerd

    Zomgerd Master Guru

    Messages:
    304
    Likes Received:
    0
    GPU:
    Asus R9 280X DC2T
    SweetFX is not currently coded for DX8, you can only run it in DX9, 10 and 11.
     
  20. player

    player Member

    Messages:
    29
    Likes Received:
    0
    GPU:
    dv6
Thread Status:
Not open for further replies.

Share This Page