SweetFX Shader Suite release and discussion thread

Discussion in 'Games, Gaming & Game-demos' started by CeeJay.dk, Sep 23, 2012.

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

    ninjafada Master Guru

    Messages:
    308
    Likes Received:
    0
    GPU:
    pny 670
    if you add search a little more it's already explained:

    in farcry3\bin
    d3d9.dll
    injector.ini

    in farcry3 the rest of the files and folder

    edit farcry3 folder rights so your account have total access

    working dx9 with overlay , not working with dx11
     
  2. StarvinMarvinDK

    StarvinMarvinDK Maha Guru

    Messages:
    1,360
    Likes Received:
    70
    GPU:
    GB Gaming OC 3080
    Many thanks :D

    Hoping for a DX11 fix :)
     
  3. sexus

    sexus Master Guru

    Messages:
    300
    Likes Received:
    0
    GPU:
    EVGA GF GTX 680 sli
    anybody have some sweet setting for resident evil 5 directx10?

    p.s: what dx11 wont work with sweetfx? since when ?
     
  4. ninjafada

    ninjafada Master Guru

    Messages:
    308
    Likes Received:
    0
    GPU:
    pny 670
    for RE5 Marcel was working on it but no news after the 1st series of screenshots

    sweetfx smaa works in dx9 dx10-11 , but in farcry dx11 crash
    sweetf fxaa doesn't works in dx10-11
     

  5. Boulotaur2024

    Boulotaur2024 Member Guru

    Messages:
    142
    Likes Received:
    0
    GPU:
    AMD HD7950
    Why ? Because I... because it never crossed my mind :D
    ... And it looks mostly the same as "my effect", you're right.

    But I still think it is a better idea to implement the blur effect into a separate Blur.h file. I might be improving it someday you know... Once I actually have an idea how HLSL works...
    By the way I found a very cool script to implement linear gaussian blur (and the results are very good to my eyes). Problem is : this is GLSL and I have no idea how to convert this to HLSL :

    Code:
    uniform sampler2D image;
    
    out vec4 FragmentColor;
    
    uniform float offset[3] = float[]( 0.0, 1.3846153846, 3.2307692308 );
    uniform float weight[3] = float[]( 0.2270270270, 0.3162162162, 0.0702702703 );
    
    void main(void)
    {
    	FragmentColor = texture2D( image, vec2([B]gl_FragCoord[/B])/1024.0 ) * weight[0];
    	for (int i=1; i<3; i++) {
    		FragmentColor += texture2D( image, ( vec2([B]gl_FragCoord[/B])+vec2(offset[i], 0.0) )/1024.0 ) * weight[i];
    		FragmentColor += texture2D( image, ( vec2([B]gl_FragCoord[/B])-vec2(offset[i], 0.0) )/1024.0 ) * weight[i];
    	}
    }
    Specially the gl_FragCoord part... it has a HLSL equivalent probably, I still need to work on the basics, but if anyone has a clue, feel free :)

    Off topic but this made me laugh way too hard :

    [​IMG]
    Dat avatar.
     
  6. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Very nice rgot. I like them a lot.

    You don't need to do that.
    Just use a negative sharp_strength to blur instead of sharpen.
    Also disable the clamp (by setting it to 1.0) or it will clamp the strength of the blur

    You can also make the blur stronger by using the wide pattern or by increasing the value of the offset bias (up to a point - after that you just cause strange artifacts)

    Photoshop blur looks nicer because it uses a wider radius.
    Making a sampling pattern that uses a larger radius is simple - making one that also performs well, is not.
    Textures samples are slow, so you'll want to use as few as possible.

    Sampling the center pixel - a 1x1 area is just one sample.
    Sampling a 3x3 area = 9 samples - not fast but not that slow either
    Sampling a 5x5 area = 25 samples - quite slow (this is about how many samples the HDR and bloom shaders each require)
    Sampling a 7x7 area = 49 samples - very slow.

    There are tricks you can do to lower the number of samples taken, but it's not easy to do, especially when I'm limited to using a single pass (which prevents me from using the best trick of them all)

    So quality-wise I can do it, but getting the shader to perform well also, will be hard.

    [​IMG]

    Those are good ideas. I had the idea myself to use the Lift Gamma Gain algorithm to control the saturation for a Vibrance shader that allowed more control, and I was also considering trying it out for the sharpening strength, as just limiting the max is a fairly simple technique and one with more control might work better.
    For instance I was thinking that I could turn down sharpening of already sharp edges to next to nothing because sharp edges didn't need extra sharpening (and that way I could prevent over sharpening) , but I could turn up sharpening of less sharp pixel and perhaps use no sharpening for pixels that had almost no contrast to it's neighbors because it was likely a gradient and I don't want to sharpen those - in fact I probably want to blur them to deband them.

    I hadn't considered the other ideas though.

    Please keep thinking of good ways to combine existing algoritms with other values, because it's fairly easy for me to take existing code and apply it to something else.

    Bloom is not that great, and I want to create my own bloom shader with a better and faster blur, but as mentioned earlier in this post, coming up with a fast way to do this won't be easy.
    Although I suppose I could at least try for a less slow way and higher quality way than the current bloom shader.

    Or change the condition (tex.y < 0.5) to (tex.y > 0.5)

    I can put in a toggle to reverse the sides if you want?

    Sure why not.
    I've seen videos on youtube that showed people doing that.
     
  7. kaicooper

    kaicooper Master Guru

    Messages:
    519
    Likes Received:
    41
    GPU:
    GTX 780 SC ACX
    where should i put the sweetfx folder in Dolphin to make it work?
     
  8. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Linear sampling is the trick I use to make LumaSharpen much faster than the PreSharpen shader in FXAAtool.
    I also do it in both the x and y dimension to get 4 samples for each texture lookup, which I then arrange so they overlap and the sampling themselves does much of the math for me so I don't need to calculate weights at all.

    I'm quite proud of that bit.

    The other trick used in the openGL shader shown on that page is separating the shader into a vertical and horizontal pass. This is the best trick and can massively reduce how many samples are needed - but it require that you can do multiple passes, and the shader injectors do not let me do this.
    I might be able to use the passes they use for SMAA/FXAA but if I do that then I can't apply AA too.

    Here's hoping for a better shader injector that allows for that.

    EDIT: BTW gl_FragCoord are the texture coordinates in GLSL.
    These are always called gl_FragCoord in GLSL, but in HLSL you assign TEXCOORD0 (and possibly TEXCOORD1, TEXCOORD2 and so on) to a variable and then reference that later.

    In most of the SweetFX shaders (if not all) it is called tex
    If you want just the x or the y part you can use tex.x or tex.y

    I do this in the Splitscreen shader if you want to look at some examples.
     
    Last edited: Dec 30, 2012
  9. kaicooper

    kaicooper Master Guru

    Messages:
    519
    Likes Received:
    41
    GPU:
    GTX 780 SC ACX
    my FINAL preset for
    Rayman Origins

    before
    [​IMG]
    after
    [​IMG]
    before
    [​IMG]
    after
    [​IMG]
    before
    [​IMG]
    after
    [​IMG]

    here's the Final config's

    Code:
       /*-----------------------------------------------------------.
      /                      Choose effects                         /
      '-----------------------------------------------------------*/
    
    // Set to 1 for ON or 0 for OFF
    #define USE_SMAA_ANTIALIASING  1            // [0 or 1] SMAA Anti-aliasing : Smoothens jagged lines.
    #define USE_LUMASHARPEN        1            // [0 or 1] LumaSharpen : Also sharpens the antialiased edges which makes them less smooth - I'm working on fixing that.
    #define USE_BLOOM              1            // [0 or 1] Bloom : Makes bright lights bleed their light into their surroundings (relatively high performance cost)
    #define USE_HDR                1            // [0 or 1] HDR : Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost)
    #define USE_TECHNICOLOR        0            // [0 or 1] TECHNICOLOR : Attempts to mimic the look of an old movie using the Technicolor three-strip color process (Techicolor Process 4)
    #define USE_DPX                0            // [0 or 1] Cineon DPX : Should make the image look like it's been converted to DXP Cineon - basically it's another movie-like look similar to technicolor.
    #define USE_LIFTGAMMAGAIN      0            // [0 or 1] Lift Gamma Gain : Adjust brightness and color of shadows, midtones and highlights (avoids clipping)
    #define USE_TONEMAP            0            // [0 or 1] Tonemap : Adjust gamma, exposure, saturation, bleach and defog. (may cause clipping)
    #define USE_VIBRANCE           1            // [0 or 1] Vibrance : Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.
    #define USE_CURVES             1            // [0 or 1] Curves : Contrast adjustments using S-curves.
    #define USE_SEPIA              1            // [0 or 1] Sepia : Sepia tones the image.
    #define USE_VIGNETTE           1            // [0 or 1] Vignette : Darkens the edges of the image to make it look more like it was shot with a camera lens. May cause banding artifacts.
    #define USE_DITHER             0            // [0 or 1] Dither : Applies dithering to simulate more colors than your monitor can display. This lessens banding artifacts (mostly caused by Vignette)
    #define USE_SPLITSCREEN        0            // [0 or 1] Splitscreen : Enables the before-and-after splitscreen comparison mode.
    
    
       /*-----------------------------------------------------------.
      /                  SMAA Anti-aliasing settings                /
      '-----------------------------------------------------------*/
    
    #define SMAA_THRESHOLD         0.05         // [0.05 to 0.20] Edge detection threshold
    #define SMAA_MAX_SEARCH_STEPS  40           // [0 to 98] Determines the radius SMAA will search for aliased edges
    #define SMAA_MAX_SEARCH_STEPS_DIAG 3            // [0 to 16] Determines the radius SMAA will search for diagonal aliased edges
    #define SMAA_CORNER_ROUNDING   100          // [0 to 100] Determines the percent of antialiasing to apply to corners.
    
    // -- Advanced SMAA settings --
    #define COLOR_EDGE_DETECTION   1            // [0 or 1] 1 Enables color edge detection (slower but slightly more acurate) - 0 uses luma edge detection (faster)
    #define SMAA_DIRECTX9_LINEAR_BLEND 1            // [0 or 1] Using DX9 HARDWARE? (software version doesn't matter) if so this needs to be 1 - If not, leave it at 0.
    
    
       /*-----------------------------------------------------------.
      /                       LumaSharpen settings                  /
      '-----------------------------------------------------------*/
    // -- Sharpening --
    #define sharp_strength         1.00         // [0.10 to 3.00] Strength of the sharpening
    #define sharp_clamp            0.035        // [0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035
    
    // -- Advanced sharpening settings --
    #define pattern                2            // [1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped.
    #define offset_bias            1.0          // [0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
                             // I designed the pattern for offset_bias 1.0, but feel free to experiment.
                               
    // -- Debug sharpening settings --
    #define show_sharpen           0            // [0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better)
    
    
       /*-----------------------------------------------------------.
      /                       Bloom settings                        /
      '-----------------------------------------------------------*/
    #define BloomThreshold         21.00        // [0.00 to 50.00] Threshold for what is a bright light (that causes bloom) and what isn't.
    #define BloomPower             1.3000       // [0.0000 to 8.0000] Strength of the bloom
    #define BloomWidth             0.0142       // [0.0000 to 1.0000] Width of the bloom
    
    
       /*-----------------------------------------------------------.
      /                        HDR settings                         /
      '-----------------------------------------------------------*/
    #define HDRPower               1.2          // [0.0 to 8.0] Strangely lowering this makes the image brighter
    #define radius2                0.82         // [0.0 to 8.0] Raising this seems to make the effect stronger and also brighter
    
    
       /*-----------------------------------------------------------.
      /                      TECHNICOLOR settings                   /
      '-----------------------------------------------------------*/
    #define TechniAmount           0.00         // [0.0 to 1.0] 
    #define TechniPower            6.0          // [0.0 to 8.0] 
    #define redNegativeAmount      1.0          // [0.0 to 1.0] 
    #define greenNegativeAmount    1.0          // [0.0 to 1.0] 
    #define blueNegativeAmount     0.60         // [0.0 to 1.0] 
    
    
       /*-----------------------------------------------------------.
      /                      Cineon DPX settings                    /
      '-----------------------------------------------------------*/
    #define Red                    8.0          // [1.0 to 15.0] 
    #define Green                  8.0          // [1.0 to 15.0] 
    #define Blue                   8.0          // [1.0 to 15.0] 
    
    #define ColorGamma             2.2          // [0.1 to 2.5] Adjusts the colorfulness of the effect in a manner similar to Vibrance. 1.0 is neutral.
    #define DPXSaturation          2.0          // [0.0 to 8.0] Adjust saturation of the effect. 1.0 is neutral.
    
    #define RedC                   0.4          // [0.6 to 0.2] 
    #define GreenC                 0.36         // [0.6 to 0.2] 
    #define BlueC                  0.5          // [0.6 to 0.2] 
    
    #define Blend                  0.2          // [0.0 to 0.1] How strong the effect should be.
    
    
       /*-----------------------------------------------------------.
      /                      Lift Gamma Gain settings               /
      '-----------------------------------------------------------*/
    #define RGB_Lift               float3(1.000, 1.000, 1.100) // [0.000 to 2.000] Adjust shadows for Red, Green and Blue
    #define RGB_Gamma              float3(1.000, 1.000, 1.000) // [0.000 to 2.000] Adjust midtones for Red, Green and Blue
    #define RGB_Gain               float3(1.000, 1.000, 1.000) // [0.000 to 2.000] Adjust highlights for Red, Green and Blue
    
    
       /*-----------------------------------------------------------.
      /                        Tonemap settings                     /
      '-----------------------------------------------------------*/
    #define Gamma                  1.00         // [0.00 to 2.00] Adjust midtones
    
    #define Exposure               0.00         // [-1.00 to 1.00] Adjust exposure
    
    #define Saturation             0.00         // [-1.00 to 1.00] Adjust saturation
    
    #define Bleach                 0.00         // [0.00 to 1.00] Brightens the shadows and fades the colors
    
    #define Defog                  0.000        // [0.00 to 1.00] How much of the color tint to remove
    #define FogColor               float3(0.00, 0.00, 2.55) // [0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to remove - default is blue
    
    
       /*-----------------------------------------------------------.
      /                       Vibrance settings                     /
      '-----------------------------------------------------------*/
    #define Vibrance               0.30         // [-1.0 to 1.0] Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.
    
    
       /*-----------------------------------------------------------.
      /                        Curves settings                      /
      '-----------------------------------------------------------*/
    #define Curves_contrast        0.00         // [-1.0 to 1.0] The amount of contrast you want
    
    // -- Advanced curve settings --
    #define Curves_formula         7            // [1|2|3|4|5|6|7] The constrast s-curve you want to use. 
    
    
       /*-----------------------------------------------------------.
      /                         Sepia settings                      /
      '-----------------------------------------------------------*/
    #define ColorTone              float3(1.0, 0.50, 0.30) // [0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to tint the image
    #define GreyPower              0.1          // [0.0 to 1.0] How much desaturate the image before tinting it
    #define SepiaPower             0.10         // [0.0 to 1.0] How much to tint the image
    
    
    
       /*-----------------------------------------------------------.
      /                       Vignette settings                     /
      '-----------------------------------------------------------*/
    #define VignetteRadius         1.25         // [-1.00 to 3.00] lower values = stronger radial effect from center
    #define VignetteAmount         -1.50        // [-2.00 to 1.00] Strength of black. -2.00 = Max Black, 1.00 = Max White.
    #define VignetteSlope          8            // [1 to 16] How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers)
    #define VignetteCenter         float2(0.500, 0.500) // [0.00 to 1.00] Center of effect.
    
    
       /*-----------------------------------------------------------.
      /                        Dither settings                      /
      '-----------------------------------------------------------*/
    //No settings yet, beyond switching it on or off in the top section.
    
    //Note that the checkerboard pattern used by Dither, makes an image harder to compress.
    //This can make your screenshots and video recordings take up more space.
    
    
       /*-----------------------------------------------------------.
      /                     Splitscreen settings                    /
      '-----------------------------------------------------------*/
    #define splitscreen_mode       1            // [1|2|3|4|5] 1 = Vertical 50/50 split, 2 = Vertical 25/50/25 split, 3 = Vertical 50/50 angled split, 4 = Horizontal 50/50 split, 5 = Horizontal 25/50/25 split

    Feel free to tell ur opinions guys
    Injoy
     
  10. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    There is no option that I am aware of that will cause FXAA to stop from damaging text and small UI elements, which is why for injection into a game after the UI have been rendered I much prefer SMAA which does very little to no damage to the details and text.

    The FXAA version that is applied by the Nvidia control panel is said to have some tweaks in it to lessen this harsh treatment of text and ui elements but it does not eliminate it.
    Also no details or code about what they did to lessen the effect on text have been released so I can't just easily duplicate it.
     

  11. OrdinaryOregano

    OrdinaryOregano Master Guru

    Messages:
    433
    Likes Received:
    5
    GPU:
    MSI 1080 Gaming X
    That won't be necessary, it isn't exactly something important, atleast IMO. But thanks.
     
  12. PandoraX357

    PandoraX357 Member

    Messages:
    14
    Likes Received:
    0
    GPU:
    560GTX-ti 2G Twin FrozrII
    @rgot Very nice shots! Especially like the sunrise! Care to share your latest Config?
     
    Last edited: Dec 30, 2012
  13. qliphoth

    qliphoth Member

    Messages:
    15
    Likes Received:
    0
    GPU:
    EVGA GTX 580 1.5GB
    Do you know how crazy this could get?!

    Oh boy.

    I like the LGG idea for Sharpen, playing with values on Dark Souls (which is a finicky game with LumaSharpen, maybe someone has some suggestions?) informed me that I like blurry darkness and crisp highlights -- the latter isn't too much of a problem with SMAA, because most often bloom and specular takes care of it. (So, just to be clear, something like shadow/midtone/highlights would end up being, as a very very rough example: -0.5,0.5,1.0.) This is not what you were talking about, but I'm a micromanagement horrorshow, I stumble in like a damn zombie and poop everywhere with demands for values to tweak.
    To be fair to you (I can do more than shout demands!), I think that tweaking the sharpening via light level should be last in the order of stuff that can be changed, after your various areas to be sharpened idea. It makes more sense that (to increase overall IQ), the various sharpening levels should be determined first by: will it be oversharpened? Will it be undersharpened? Will it uglify a gradient? And then altered by: did the nice guy/gal at the computer tell me to sharpen darkness, midtones and highlights, and how much?

    That's all I have for now.... but that's just until I find myself getting fed up trying to tweak something else to my liking and which seems likely to be easy to adapt.

    (BUT. I looked through your pseudo-HDR code and... I don't see any way to do this, but maybe you know of a way. Change the point where it stops darkening and starts brightening things, without tweaking the two current values? I have a hard time balancing a ratio of light/dark with decent hightlights and shadows. It seems to like to drop the highlights way down or raise the shadows way up when you start tweaking it. Again, I did have a look so I know to some degree how difficult it might be. Consider it a wish, not a request or suggestion.)
     
  14. Boulotaur2024

    Boulotaur2024 Member Guru

    Messages:
    142
    Likes Received:
    0
    GPU:
    AMD HD7950
    Chromatic Aberration effect

    off
    [​IMG]

    on
    [​IMG]

    on with blur (sorry I can't help it)
    [​IMG]

    Some piece of code I stole from ENB (hope you guys don't mind, I can delete this post otherwise :D) :

    Replace the content of your Dither.h with :

    Code:
    #define CHROMA_POW		35.0
     
    float3 fvChroma = float3(0.995, 1.000, 1.005);
     
    float4 ChromaticAberrationFocus(float2 tex, float outOfFocus)
    {
    	float3 chroma = pow(fvChroma, CHROMA_POW * outOfFocus);
    
    	float2 tr = ((2.0 * tex - 1.0) * chroma.r) * 0.5 + 0.5;
    	float2 tg = ((2.0 * tex - 1.0) * chroma.g) * 0.5 + 0.5;
    	float2 tb = ((2.0 * tex - 1.0) * chroma.b) * 0.5 + 0.5;
    	
    	float3 color = float3(myTex2D(s0, tr).r, myTex2D(s0, tg).g, myTex2D(s0, tb).b) * (1.0 - outOfFocus);
    	
    	return float4(color, 1.0);
    }
    
    float4 DitherPass(float4 colorInput, float2 tex)
    {
        float4 [B]outfocus [/B]= 0.016;
    	return ChromaticAberrationFocus(tex, outfocus);
    }
    Don't forget to switch USE_DITHER on in your SweetFX_settings.txt
    You can tweak the amount of the effect by increasing/decreasing the outfocus variable

    A few pictures of RE4 in Dolphin upscaled x3 + 9xSSAA - Blur/Overlay/Chromatic aberration :

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]

    [​IMG]
    I didn't even use Sweetfx levels, just a lucky combination of the source image overlayed with the blurred & grayscaled source image + chromatic aberration.
     
    Last edited: Dec 30, 2012
  15. ninjafada

    ninjafada Master Guru

    Messages:
    308
    Likes Received:
    0
    GPU:
    pny 670
    you could have done it without changing an over shader

    ChromaticAberration.h
    Code:
    /*------------------------------------------------------------------------------
    			Chromatic Aberration
    ------------------------------------------------------------------------------*/
    
    #define CHROMA_POW		35.0
     
    float3 fvChroma = float3(0.995, 1.000, 1.005);
     
    float4 ChromaticAberrationFocus(float2 tex, float outOfFocus)
    {
    	float3 chroma = pow(fvChroma, CHROMA_POW * outOfFocus);
    
    	float2 tr = ((2.0 * tex - 1.0) * chroma.r) * 0.5 + 0.5;
    	float2 tg = ((2.0 * tex - 1.0) * chroma.g) * 0.5 + 0.5;
    	float2 tb = ((2.0 * tex - 1.0) * chroma.b) * 0.5 + 0.5;
    	
    	float3 color = float3(myTex2D(s0, tr).r, myTex2D(s0, tg).g, myTex2D(s0, tb).b) * (1.0 - outOfFocus);
    	
    	return float4(color, 1.0);
    }
    
    float4 CAPass(float4 colorInput, float2 tex)
    {
    	return ChromaticAberrationFocus(tex, outfocus);
    }
    main.h
    Code:
       /*-----------------------------------------------------------.   
      /                 Defining constants                          /
      '-----------------------------------------------------------*/
    
    //These values are normally defined by the injector dlls, but not when anylyzed by GPU Shaderanalyzer
    //I need to ensure they always have a value to be able to compile them whenever I'm not using the injector.
    #ifdef SMAA_PIXEL_SIZE
      #ifndef BUFFER_RCP_WIDTH
        #define BUFFER_RCP_WIDTH SMAA_PIXEL_SIZE.x
        #define BUFFER_RCP_HEIGHT SMAA_PIXEL_SIZE.y
        #define BUFFER_WIDTH (1.0 / SMAA_PIXEL_SIZE.x)
        #define BUFFER_HEIGHT (1.0 / SMAA_PIXEL_SIZE.y)
      #endif
    #endif
    
    #ifndef BUFFER_RCP_WIDTH
      #define BUFFER_RCP_WIDTH (1.0 / 1680)
      #define BUFFER_RCP_HEIGHT (1.0 / 1050)
      #define BUFFER_WIDTH 1680
      #define BUFFER_HEIGHT 1050
    #endif
    
    #define screen_size float2(BUFFER_WIDTH,BUFFER_HEIGHT)
    
    #define px BUFFER_RCP_WIDTH
    #define py BUFFER_RCP_HEIGHT
    
    #define pixel float2(px,py)
    
    // -- Define DirectX9 FXAA specific aliases --
    #if FXAA_HLSL_3 == 1
      #define myTex2D(s,p) tex2D(s,p)
      
      //#define s0 colorTexG
      //#define s1 colorTexG //TODO make a nearest sampler if needed
    #endif
    
    // -- Define DirectX10/11 FXAA specific aliases --
    #if FXAA_HLSL_5 == 1
      #define myTex2D(s,p) s.SampleLevel(screenSampler, p, 0)
    
      #define s0 gLumaTexture
      #define s1 gLumaTexture //TODO make a nearest sampler if needed
    #endif
    
    
    // -- Define DirectX9 specific aliases --
    #if SMAA_HLSL_3 == 1
      #define myTex2D(s,p) tex2D(s,p)
      
      #define s0 colorTexG
      #define s1 colorTexG //TODO make a nearest sampler if needed
    #endif
    
    // -- Define DirectX10/11 specific aliases --
    #if SMAA_HLSL_4 == 1 || SMAA_HLSL_4_1 == 1
      #define myTex2D(s,p) s.SampleLevel(LinearSampler, p, 0)
    
      #define s0 colorTexGamma
      #define s1 colorTexGamma //TODO make a nearest sampler if needed
    #endif
    
       /*-----------------------------------------------------------.   
      /                 Including enabled shaders                   /
      '-----------------------------------------------------------*/
    
    
    #if (USE_LUMASHARPEN == 1)
        #include "SweetFX\Shaders\LumaSharpen.h"
    #endif
    
    #if (USE_HDR == 1)
        #include "SweetFX\Shaders\HDR.h"
    #endif
    
    #if (USE_BLOOM == 1)
        #include "SweetFX\Shaders\Bloom.h"
    #endif
    
    #if (USE_TECHNICOLOR == 1)
        #include "SweetFX\Shaders\Technicolor.h"
    #endif
    
    #if (USE_DPX == 1)
        #include "SweetFX\Shaders\DPX.h"
    #endif
    
    #if (USE_LIFTGAMMAGAIN == 1)
    	#include "SweetFX\Shaders\LiftGammaGain.h"
    #endif
    
    #if (USE_TONEMAP == 1)
        #include "SweetFX\Shaders\Tonemap.h"
    #endif
    
    #if (USE_SEPIA == 1)
        #include "SweetFX\Shaders\Sepia.h"
    #endif
    
    #if (USE_VIBRANCE == 1)
        #include "SweetFX\Shaders\Vibrance.h"
    #endif
    
    #if (USE_CURVES == 1)
        #include "SweetFX\Shaders\Curves.h"
    #endif
    
    #if (USE_CARTOON == 1)
        #include "SweetFX\Shaders\Cartoon.h"
    #endif
    
    #if (USE_VIGNETTE == 1)
        #include "SweetFX\Shaders\Vignette.h"
    #endif
    
    #if (USE_CA == 1)
        #include "SweetFX\Shaders\ChromaticAberration.h"
    #endif
    
    #if (USE_DITHER == 1)
        #include "SweetFX\Shaders\Dither.h"
    #endif
    
    #if (USE_BORDER == 1)
        #include "SweetFX\Shaders\Border.h"
    #endif
    
    #if (USE_SPLITSCREEN == 1)
        #include "SweetFX\Shaders\Splitscreen.h"
    #endif
    
       /*-----------------------------------------------------------.   
      /                        Effect passes                        /
      '-----------------------------------------------------------*/
    
    float4 main(float2 tex, float4 FinalColor)
    {
    //    FinalColor.rgb = (FinalColor.rgb <= 0.03928) ? FinalColor.rgb / 12.92 : pow( (FinalColor.rgb + 0.055) / 1.055, 2.4 ); // SRGB to Linear
    
    
        // Linear to SRGB gamma correction. Needed here because SMAA uses linear for it's final step while the other shaders use SRGB.
        #if (USE_SMAA_ANTIALIASING == 1)
        FinalColor.rgb = (FinalColor.rgb <= 0.00304) ? saturate(FinalColor.rgb) * 12.92 : 1.055 * pow( saturate(FinalColor.rgb), 1.0/2.4 ) - 0.055; // Linear to SRGB
    	#endif
    
    	// LumaSharpen (has to be the first pass because it samples multiple texels)
        #if (USE_LUMASHARPEN == 1)
    		FinalColor = LumaSharpenPass(FinalColor,tex);
    	#endif
    	
    	// Bloom
        #if (USE_BLOOM == 1)
    		FinalColor = BloomPass (FinalColor,tex);
    	#endif
    	
    	// HDR
        #if (USE_HDR == 1)
    		FinalColor = HDRPass (FinalColor,tex);
    	#endif
    	
    	// Technicolor
        #if (USE_TECHNICOLOR == 1)
    		FinalColor = TechnicolorPass(FinalColor);
    	#endif
    	
    	// DPX
        #if (USE_DPX == 1)
    		FinalColor = DPXPass(FinalColor);
    	#endif
    	
    	// Lift Gamma Gain
        #if (USE_LIFTGAMMAGAIN == 1)
    		FinalColor = LiftGammaGainPass(FinalColor);
    	#endif
    	
    	// Tonemap
    	#if (USE_TONEMAP == 1)
    		FinalColor = TonemapPass(FinalColor);
    	#endif
    	
    	// Vibrance
    	#if (USE_VIBRANCE == 1)
    		FinalColor = VibrancePass(FinalColor);
    	#endif
    	
    	// Curves
    	#if (USE_CURVES == 1)
    		FinalColor = CurvesPass(FinalColor);
    	#endif
    
    	// Cartoon
      #if (USE_CARTOON == 1)
    		FinalColor = CartoonPass(FinalColor,tex);
    	#endif
    	// Chromatic Aberration	
    	#if (USE_CA == 1)
    		FinalColor = CAPass(FinalColor,tex);
    	#endif
    
    	// Sepia
    	#if (USE_SEPIA == 1)
        FinalColor = SepiaPass (FinalColor);
    	#endif
    	
    	// Vignette
    	#if (USE_VIGNETTE == 1)
    		FinalColor = VignettePass(FinalColor,tex);
    	#endif
    
    	// Dither (should go near the end as it only dithers what went before it)
    	#if (USE_DITHER == 1)
    		FinalColor = DitherPass(FinalColor,tex);
    	#endif
    	
    	// Border
    	#if (USE_BORDER == 1)
        FinalColor = BorderPass(FinalColor,tex);
      #endif
    	
    	// Splitscreen
    	#if (USE_SPLITSCREEN == 1)
    		FinalColor = SplitscreenPass(FinalColor,tex);
    	#endif
    	
      // SRGB to Linear gamma correction. (Hmm should this go after Dither? .. TODO: investigate)
      #if (USE_SMAA_ANTIALIASING == 1 && SMAA_HLSL_3 != 1) //Only for DirectX 10/11
        FinalColor.rgb = (FinalColor.rgb <= 0.03928) ? saturate(FinalColor.rgb) / 12.92 : pow( (saturate(FinalColor.rgb) + 0.055) / 1.055, 2.4 ); // SRGB to Linear
    	#endif
    
    	// Return FinalColor
    	return FinalColor;
    }
    
    SweetFX_settings.txt
    Code:
       /*-----------------------------------------------------------.
      /                      Choose effects                         /
      '-----------------------------------------------------------*/
    
    // Set to 1 for ON or 0 for OFF
    #define USE_SMAA_ANTIALIASING 1 //[0 or 1] SMAA Anti-aliasing : Smoothens jagged lines using the SMAA technique.
    #define USE_FXAA_ANTIALIASING 0 //[0 or 1] FXAA Anti-aliasing : Smoothens jagged lines using the FXAA technique. WIP - Currently only works in DX9 and you need to use the FXAA injector dlls.
    #define USE_LUMASHARPEN   1 //[0 or 1] LumaSharpen : Also sharpens the antialiased edges which makes them less smooth - I'm working on fixing that.
    #define USE_BLOOM         0 //[0 or 1] Bloom : Makes bright lights bleed their light into their surroundings (relatively high performance cost)
    #define USE_HDR           0 //[0 or 1] HDR : Not actual HDR - It just tries to mimic an HDR look (relatively high performance cost)
    #define USE_TECHNICOLOR   0 //[0 or 1] TECHNICOLOR : Attempts to mimic the look of an old movie using the Technicolor three-strip color process (Techicolor Process 4)
    #define USE_DPX           1 //[0 or 1] Cineon DPX : Should make the image look like it's been converted to DXP Cineon - basically it's another movie-like look similar to technicolor.
    #define USE_LIFTGAMMAGAIN 1 //[0 or 1] Lift Gamma Gain : Adjust brightness and color of shadows, midtones and highlights (avoids clipping)
    #define USE_TONEMAP       0 //[0 or 1] Tonemap : Adjust gamma, exposure, saturation, bleach and defog. (may cause clipping)
    #define USE_VIBRANCE      1 //[0 or 1] Vibrance : Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.
    #define USE_CURVES        0 //[0 or 1] Curves : Contrast adjustments using S-curves.
    #define USE_CARTOON       1 //[0 or 1] Cartoon : "Toon"s the image
    #define USE_SEPIA         0 //[0 or 1] Sepia : Sepia tones the image.
    #define USE_VIGNETTE      0 //[0 or 1] Vignette : Darkens the edges of the image to make it look more like it was shot with a camera lens. May cause banding artifacts.
    #define USE_CA            0 //[0 or 1] Chromatic aberration
    #define USE_DITHER        0 //[0 or 1] Dither : Applies dithering to simulate more colors than your monitor can display. This lessens banding artifacts (mostly caused by Vignette)
    #define USE_BORDER        1 //[0 or 1] Border : Makes the screenedge black as a workaround for the bright edge that forcing some AA modes sometimes causes.
    #define USE_SPLITSCREEN   0 //[0 or 1] Splitscreen : Enables the before-and-after splitscreen comparison mode.
    
    
       /*-----------------------------------------------------------.
      /                  SMAA Anti-aliasing settings                /
      '-----------------------------------------------------------*/
    
    #define SMAA_THRESHOLD 0.05           //[0.05 to 0.20] Edge detection threshold
    #define SMAA_MAX_SEARCH_STEPS 32      //[0 to 98] Determines the radius SMAA will search for aliased edges
    #define SMAA_MAX_SEARCH_STEPS_DIAG 16  //[0 to 16] Determines the radius SMAA will search for diagonal aliased edges
    #define SMAA_CORNER_ROUNDING 0        //[0 to 100] Determines the percent of antialiasing to apply to corners.
    
    // -- Advanced SMAA settings --
    #define COLOR_EDGE_DETECTION 1        //[0 or 1] 1 Enables color edge detection (slower but more acurate) - 0 uses luma edge detection (faster)
    #define SMAA_DIRECTX9_LINEAR_BLEND 0  //[0 or 1] Using DX9 HARDWARE? (software version doesn't matter) if so this needs to be 1 - If not, leave it at 0.
    
    
       /*-----------------------------------------------------------.
      /                  FXAA Anti-aliasing settings                /
      '-----------------------------------------------------------*/
    #define FXAA_QUALITY__PRESET 9       //[1 to 9] Choose the quality preset
    #define fxaa_Subpix 0.400            //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal
    #define fxaa_EdgeThreshold 0.250     //[0.000 to 1.000] The minimum amount of local contrast required to apply algorithm
    #define fxaa_EdgeThresholdMin 0.060  //[0.000 to 1.000] Trims the algorithm from processing darks
    
    
       /*-----------------------------------------------------------.
      /                       LumaSharpen settings                  /
      '-----------------------------------------------------------*/
    // -- Sharpening --
    #define sharp_strength 1.20   //[0.10 to 3.00] Strength of the sharpening
    #define sharp_clamp    0.025  //[0.000 to 1.000] Limits maximum amount of sharpening a pixel recieves - Default is 0.035
    
    // -- Advanced sharpening settings --
    #define pattern 3        //[1|2|3|4] Choose a sample pattern. 1 = Fast, 2 = Normal, 3 = Wider, 4 = Pyramid shaped.
    #define offset_bias 1.0  //[0.0 to 6.0] Offset bias adjusts the radius of the sampling pattern.
                             //I designed the pattern for offset_bias 1.0, but feel free to experiment.
                               
    // -- Debug sharpening settings --
    #define show_sharpen 0   //[0 or 1] Visualize the strength of the sharpen (multiplied by 4 to see it better)
    
    
       /*-----------------------------------------------------------.
      /                       Bloom settings                        /
      '-----------------------------------------------------------*/
    #define BloomThreshold 20.25 //[0.00 to 50.00] Threshold for what is a bright light (that causes bloom) and what isn't.
    #define BloomPower 1.446     //[0.000 to 8.000] Strength of the bloom
    #define BloomWidth 0.0142    //[0.0000 to 1.0000] Width of the bloom
    
    
       /*-----------------------------------------------------------.
      /                        HDR settings                         /
      '-----------------------------------------------------------*/
    #define HDRPower 1.20  //[0.00 to 8.00] Strangely lowering this makes the image brighter
    #define radius2  0.85  //[0.00 to 8.00] Raising this seems to make the effect stronger and also brighter
    
    
       /*-----------------------------------------------------------.
      /                      TECHNICOLOR settings                   /
      '-----------------------------------------------------------*/
    #define TechniAmount 0.4         //[0.0 to 1.0]
    #define TechniPower  4.0         //[0.0 to 8.0]
    #define redNegativeAmount   0.88 //[0.0 to 1.0]
    #define greenNegativeAmount 0.88 //[0.0 to 1.0]
    #define blueNegativeAmount  0.88 //[0.0 to 1.0]
    
    
       /*-----------------------------------------------------------.
      /                      Cineon DPX settings                    /
      '-----------------------------------------------------------*/
    #define Red   15.0  //[1.0 to 15.0]
    #define Green 15.0  //[1.0 to 15.0]
    #define Blue  15.0  //[1.0 to 15.0]
    
    #define ColorGamma    2.5  //[0.1 to 2.5] Adjusts the colorfulness of the effect in a manner similar to Vibrance. 1.0 is neutral.
    #define DPXSaturation 1.35  //[0.0 to 8.0] Adjust saturation of the effect. 1.0 is neutral.
    
    #define RedC   0.36  //[0.60 to 0.20]
    #define GreenC 0.36  //[0.60 to 0.20]
    #define BlueC  0.34  //[0.60 to 0.20]
    
    #define Blend 0.14    //[0.00 to 1.00] How strong the effect should be.
    
    
       /*-----------------------------------------------------------.
      /                      Lift Gamma Gain settings               /
      '-----------------------------------------------------------*/
    #define RGB_Lift  float3(0.970, 0.970, 0.970)  //[0.000 to 2.000] Adjust shadows for Red, Green and Blue
    #define RGB_Gamma float3(0.980, 0.980, 0.980)  //[0.000 to 2.000] Adjust midtones for Red, Green and Blue
    #define RGB_Gain  float3(1.050, 1.050, 1.050)  //[0.000 to 2.000] Adjust highlights for Red, Green and Blue
    
    
       /*-----------------------------------------------------------.
      /                        Tonemap settings                     /
      '-----------------------------------------------------------*/
    #define Gamma 1.02        //[0.000 to 2.000] Adjust midtones
    
    #define Exposure 0.00    //[-1.000 to 1.000] Adjust exposure
    
    #define Saturation -0.20  //[-1.000 to 1.000] Adjust saturation
    
    #define Bleach 0.00      //[0.000 to 1.000] Brightens the shadows and fades the colors
    
    #define Defog 0.000  //[0.000 to 1.000] How much of the color tint to remove
    #define FogColor float3(0.00, 0.00, 2.55) //[0.00 to 2.55, 0.00 to 2.55, 0.00 to 2.55] What color to remove - default is blue
    
    
       /*-----------------------------------------------------------.
      /                       Vibrance settings                     /
      '-----------------------------------------------------------*/
    #define Vibrance 0.15 //[-1.00 to 1.00] Intelligently saturates (or desaturates if you use negative values) the pixels depending on their original saturation.
    
    
       /*-----------------------------------------------------------.
      /                        Curves settings                      /
      '-----------------------------------------------------------*/
    #define Curves_contrast 0.20  //[-1.00 to 1.00] The amount of contrast you want
    
    // -- Advanced curve settings --
    #define Curves_formula 2      //[1|2|3|4|5|6|7] The constrast s-curve you want to use. I prefer 2 myself.
    
    
       /*-----------------------------------------------------------.
      /                       Cartoon settings                      /
      '-----------------------------------------------------------*/
    #define Cartoonpower 0.5  // [0.1 to 10.0 ] The amount of effect
    
       /*-----------------------------------------------------------.
      /                         Sepia settings                      /
      '-----------------------------------------------------------*/
    #define ColorTone float3(1.40, 1.10, 0.90) //[0.00 to 1.00, 0.00 to 1.00, 0.00 to 1.00] What color to tint the image
    #define GreyPower  0.11                    //[0.0 to 1.0] How much desaturate the image before tinting it
    #define SepiaPower 0.58                    //[0.0 to 1.0] How much to tint the image
    
    
       /*-----------------------------------------------------------.
      /                       Vignette settings                     /
      '-----------------------------------------------------------*/
    #define VignetteRadius 1.00   //[-1.00 to 3.00] lower values = stronger radial effect from center
    #define VignetteAmount -1.00  //[-2.00 to 1.00] Strength of black. -2.00 = Max Black, 1.00 = Max White.
    #define VignetteSlope 8       //[1 to 16] How far away from the center the change should start to really grow strong (odd numbers cause a larger fps drop than even numbers)
    #define VignetteCenter float2(0.500, 0.500)  //[0.00 to 1.00, 0.00 to 1.00] Center of effect.
    
    
       /*-----------------------------------------------------------.
      /                       Chromatic aberration                  /
      '-----------------------------------------------------------*/
    #define outfocus 0.016  //
    
       /*-----------------------------------------------------------.
      /                        Dither settings                      /
      '-----------------------------------------------------------*/
    //No settings yet, beyond switching it on or off in the top section.
    
    //Note that the checkerboard pattern used by Dither, makes an image harder to compress.
    //This can make your screenshots and video recordings take up more space.
    
    
       /*-----------------------------------------------------------.
      /                        Border settings                      /
      '-----------------------------------------------------------*/
    //No settings yet, beyond switching it on or off in the top section.
    
    
       /*-----------------------------------------------------------.
      /                     Splitscreen settings                    /
      '-----------------------------------------------------------*/
    #define splitscreen_mode 1  //[1|2|3|4|5]  1 = Vertical 50/50 split, 2 = Vertical 25/50/25 split, 3 = Vertical 50/50 angled split, 4 = Horizontal 50/50 split, 5 = Horizontal 25/50/25 split
    
    

    it's a weird effect , hard to find a use of it because the range isn't dynamic
     
    Last edited: Dec 30, 2012

  16. qliphoth

    qliphoth Member

    Messages:
    15
    Likes Received:
    0
    GPU:
    EVGA GTX 580 1.5GB
    I want to say that it's possible to change that. You'd have to probably use LGG or DPX or even Technicolor as a base, in order to seperate the RGB channels -- box blur blue in one direction by a small amount, red the opposite by the same amount, which would probably be tweakable. Now the real issue here is that it looks real ugly in the middle of your screen all the damn time. You'd need to find some way to use vignette's code to quarantine it to the edges of the screen.

    Oh, and by the way -- by that point the shader will probably have been completely rewritten, a little piece at a time. Yay!
     
  17. StixsmasterHD

    StixsmasterHD Member

    Messages:
    49
    Likes Received:
    0
    GPU:
    NVIDIA GeForce GTS 240
    Hey all,

    Been a minute since I visit this thread.

    Thought I would post my latest works pics here for all to check out:

    Regular:
    [​IMG]

    Sweetfx:
    [​IMG]

    Regular:
    [​IMG]

    Sweetfx:
    [​IMG]

    Regular:
    [​IMG]

    Sweetfx:
    [​IMG]

    Hope all enjoy.
     
  18. Linthiel

    Linthiel New Member

    Messages:
    2
    Likes Received:
    0
    GPU:
    ATI HD6850
    GIMP (shareware substitute for photoshop) has an option under the Photo section to add GLOW to the image. It's really nice and lets to change the radius, brightness and contrast of the glow, can you add something like that?
     
  19. kaicooper

    kaicooper Master Guru

    Messages:
    519
    Likes Received:
    41
    GPU:
    GTX 780 SC ACX
    cant c anything..upload them again..there's somthing worng
     
  20. Wanny

    Wanny Guest

    ENB got an injector version and I was wondering if it was possible for the same thing with SweetFX? I have a game right now that will only work with the injector version of ENB but since SweetFX is using that d3d9.dll it just won't work (even as a proxy).

    Why would the wrapper version not work and the injector version work? What's different in those DLLs ? SweetFX is clearly a wrapper version too.

    edit: Okay NVM finally got it working.
     
    Last edited by a moderator: Dec 30, 2012
Thread Status:
Not open for further replies.

Share This Page