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

    Boulotaur2024 Member Guru

    Messages:
    142
    Likes Received:
    0
    GPU:
    AMD HD7950
    Yup, I found the original CineStyle LUT file on some Mediafire account after searching really hard (Technicolor has removed it from their downloads).
    Now I don't really know what to do with that, my math skills really suck I'm ashamed... Can you deduce a working function out of that ?

    I wish I had Excel installed or some spreadsheet software to do what this guy does...

    EDIT : I found what could be the formula for it. But he works in 16 bits, I guess everything works in 8 bits in HLSL (?)

    EDIT : ok I'm kinda stucked here, I'm trying to translate the above function :

    Code:
    a  = 0.05
    x1 = (x - 32768) / 32768        ; x1 in -1...1
    x2 =   1.5   * x1 - 0.5 * x1^3  ; 1st S curve
    x3 = (1 + a) * x2 -   a * x2^3  ; 2nd S curve
    y  = x3 * 32768 + 32768         ; Back to 0...65535
    ... Into Sweetfx (I created a new pattern) :

    Code:
      #if Curves_formula == 8
    	float a  = 0.05;
    	float x1 = (luma - 128) / 128;                  // ; x1 in -1...1
    	float x2 = 1.5 * x1 - 0.5 * (pow(x1, 3));       // ; 1st S curve
    	float x3 = (1 + a) * x2 - a * (pow(x2, 3));     // ; 2nd S curve
    	float y  = x3 * 128 + 128;                      // ; Back to 0...255
    		
    	luma = y;
    	
    	// -> 1 line function (hoping that I could test this with Graph Toy)
        // luma = ((1 + 0.05) * (1.5 * ((luma - 128) / 128) - 0.5 * (pow(((luma - 128) / 128), 3))) - 0.05 * (pow((1.5 * ((luma - 128) / 128) - 0.5 * (pow(((luma - 128) / 128), 3))), 3))) * 128 + 128;
      #endif
    It compiles fine, it somewhat works in-game, but the result is totally incorrect of course
    I'm assuming we're working in 8 bits and not in 16 bits like in the original function that's why I replaced the original value of 32768 with 128 (32768 is half 65536, 128 is half... 256, right ?)

    I must be doing something wrong but I don't know what... Also it doesn't help that I was never really good at maths :(
     
    Last edited: Jan 3, 2013
  2. OrdinaryOregano

    OrdinaryOregano Master Guru

    Messages:
    426
    Likes Received:
    1
    GPU:
    MSI 1080 Gaming X
    For the love of...SweetFX, put your pics in spoiler tags!
     
  3. TonyTurbo

    TonyTurbo Master Guru

    Messages:
    233
    Likes Received:
    16
    GPU:
    Vega 64 @ 1750/1180
    how do you do that if you dont mind me asking? Was trying to figure it out last night but failed.

    edit: nevermind figured it out

    apologies
     
    Last edited: Jan 3, 2013
  4. jim2point0

    jim2point0 Maha Guru

    Messages:
    1,348
    Likes Received:
    42
    GPU:
    Asus Strix 2080TI
    You're not my dad!
     

  5. ninjafada

    ninjafada Master Guru

    Messages:
    308
    Likes Received:
    0
    GPU:
    pny 670
    and remove img from quote too ;;

    and jim ! *hard breathing * i'm your father ! :vader:
     
  6. kaicooper

    kaicooper Master Guru

    Messages:
    519
    Likes Received:
    41
    GPU:
    GTX 780 SC ACX
    hi bro..u remember me?

    thanx man for this profile ..V2 THE BEST
     
  7. OrdinaryOregano

    OrdinaryOregano Master Guru

    Messages:
    426
    Likes Received:
    1
    GPU:
    MSI 1080 Gaming X
    How dare you!
    Everything I've taught you, everything I've done for you and you have the nerve to call to publicly hail I'm not your father.

    I thought I was beyond this...
    I thought perhaps we could live peacefully that you would understand, but your insolence knows no bounds!

    I am sorry Jim.
    *stabs Jim to death*
     
  8. Scorpio82Co

    Scorpio82Co Member Guru

    Messages:
    180
    Likes Received:
    0
    GPU:
    Gigabyte GTX1070 G1 8GB

    did i missed something?? the enb doesnt work (the d3d9.dll in specific..). i dont know what to do (and i run in dx 9)
     
  9. kaicooper

    kaicooper Master Guru

    Messages:
    519
    Likes Received:
    41
    GPU:
    GTX 780 SC ACX
    loool like that
    that means no Mass Effect 4 :bang:
     
  10. Rich_Guy

    Rich_Guy Ancient Guru

    Messages:
    12,281
    Likes Received:
    445
    GPU:
    MSI 2070S X-Trio
    Decided to try this again, seen as i couldn't get it working last time, and managed to get it working now (thanks to the game compatability readme telling you how to use it with certain games, i.e Crysis), seems to make everything look really sharp (like grainy), and more colourful. :D
     

  11. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    Dammit Jim. I'm a doctor - not a miracle worker!
     
  12. Rich_Guy

    Rich_Guy Ancient Guru

    Messages:
    12,281
    Likes Received:
    445
    GPU:
    MSI 2070S X-Trio
    Can't use it in Dead Space, makes the mouse go really slow for some reason.
     
  13. Boulotaur2024

    Boulotaur2024 Member Guru

    Messages:
    142
    Likes Received:
    0
    GPU:
    AMD HD7950
    I might be getting somewhere mathematically speaking ( :D ) :

    Ceejay, if you paste this formula into Graph Toy :
    Code:
    (1.0 + 0.05) * (1.5 * x - 0.5 * pow(x, 3)) - 0.05 * (pow((1.5 * x - 0.5 * pow(x, 3)), 3))
    [​IMG]

    You get a nice s-shaped curve, I think it looks really close to the Technicolor one (doesn't it ?)
    (I was erroneously converting values to and back to 0-255 in my previous attempt).

    Here is the "fixed" code :

    Code:
      #if Curves_formula == 8
    	//float a  = 0.05;
    	//float x2 = 1.5 * luma - 0.5 * pow(luma, 3);       // ; 1st S curve
    	//float x3 = (1.0 + a) * x2 - a * (pow(x2, 3));     // ; 2nd S curve
    		
    	//luma = x3;
    	
    	// -> 1 line function
        luma = (1.0 + 0.05) * (1.5 * luma - 0.5 * pow(luma, 3)) - 0.05 * (pow((1.5 * luma - 0.5 * pow(luma, 3)), 3));
      #endif	
    Problem is I'm not getting the expected results when this is applied in-game, whatever the value of Curves_contrast.
    It doesn't look like the result I'd get with that same curve applied in Gimp or anywhere else...

    Is it because Sweetfx right now only processes the luma while Gimp (apparently) processes both luma & chroma ?
     
    Last edited: Jan 3, 2013
  14. kaneos

    kaneos Active Member

    Messages:
    70
    Likes Received:
    0
    GPU:
    MSI Gaming 1080 TI
    Hello !

    After to have made a preset for Bioshock, i realized a preset for Tomb Raider : Anniversary.

    Here somes screenshots

    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]
    *
    [​IMG]

    Settings :
    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 1 //[0 or 1] Lift Gamma Gain : Adjust brightness and color of shadows, midtones and highlights (avoids clipping)
    #define USE_TONEMAP       1 //[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         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_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.12           // [0.05 to 0.20] Edge detection threshold
    #define SMAA_MAX_SEARCH_STEPS 16      // [0 to 98] Determines the radius SMAA will search for aliased edges
    #define SMAA_MAX_SEARCH_STEPS_DIAG 6  // [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 slightly 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.
    
    
       /*-----------------------------------------------------------.
      /                       LumaSharpen settings                  /
      '-----------------------------------------------------------*/
    // -- Sharpening --
    #define sharp_strength 0.60   // [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 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.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.30  //[0.0 to 8.0] Strangely lowering this makes the image brighter
    #define radius2  0.80  //[0.0 to 8.0] Raising this seems to make the effect stronger and also brighter
    
    
       /*-----------------------------------------------------------.
      /                      TECHNICOLOR settings                   /
      '-----------------------------------------------------------*/
    #define TechniAmount 0.11        //[0.0 to 1.0]
    #define TechniPower  2.8         //[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   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.5  //[0.1 to 2.5] Adjusts the colorfulness of the effect in a manner similar to Vibrance. 1.0 is neutral.
    #define DPXSaturation 3.0  //[0.0 to 8.0] Adjust saturation of the effect. 1.0 is neutral.
    
    #define RedC   0.36  //[0.6 to 0.2]
    #define GreenC 0.36  //[0.6 to 0.2]
    #define BlueC  0.34  //[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.000)  //[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.1        //[0.00 to 2.00] Adjust midtones
    
    #define Exposure 0.00    //[-1.00 to 1.00] Adjust exposure
    
    #define Saturation 0.20  //[-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.40  //[-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.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] 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 3  //[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
    
    
    
     
  15. sexus

    sexus Master Guru

    Messages:
    300
    Likes Received:
    0
    GPU:
    EVGA GF GTX 680 sli
    Boulotaur2024

    keep it up cant wait for the perfected resident evil 5 setup , im patiently waiting , great work so far
     

  16. Boulotaur2024

    Boulotaur2024 Member Guru

    Messages:
    142
    Likes Received:
    0
    GPU:
    AMD HD7950
    I already released the ENB :
    http://enbdev.com/enbseries/forum/viewtopic.php?f=11&t=1423

    Like I said, it won't be as good as the screenshots last page because it doesn't feature a "proper" (at least for me) levels correction.
    Beside "desaturation", it only does a full range to pc levels conversion (it IS costly on the GPU, I just realized that, damn), which I borrowed from Jan-Willem Krans video shader pack.

    To be honest I don't think I'll work any further on the ENB, code is messy as hell and unsupported and Boris is... who he is... If anything I'd rather help with Sweetfx in the future :)
     
    Last edited: Jan 3, 2013
  17. sexus

    sexus Master Guru

    Messages:
    300
    Likes Received:
    0
    GPU:
    EVGA GF GTX 680 sli
    sure thing , was maybe thinking about sweetfx too, maybe fix what is missing from enbs tweaks with sweetfx , like marcel uses with skyrim , he uses a mix out of enb combined with sweetfx to get his settings right , what you say you still up to perfecting resident evil 5 or what, btw am lovin what youve done so far with enb , a heck alot better than before with regular enbs default re5 settings, re5 disneyland , lols ;)
     
    Last edited: Jan 3, 2013
  18. BetA

    BetA Ancient Guru

    Messages:
    4,178
    Likes Received:
    163
    GPU:
    MSI GTX670 PEOC@1350Mhz
    niceeeeee..

    i love the "(slight) chromatic aberration)", any chance this works for other games too? *i dont know much about ENB*

    i can see a lot of potential for this effect in a lot of games..it makes it, hmm, how do i say this.....not realistic, mehh maybe a little, no what i mean is, it looks more alive?!?!?!

    anyway, great post...

    -BetA-
     
  19. sexus

    sexus Master Guru

    Messages:
    300
    Likes Received:
    0
    GPU:
    EVGA GF GTX 680 sli
    Last edited: Jan 3, 2013
  20. CeeJay.dk

    CeeJay.dk Master Guru

    Messages:
    689
    Likes Received:
    8
    GPU:
    Radeon 6870
    I had considered that it looks like Gimp processes each RGBA channel separately while I chose to process luma and keep chroma unchanged.

    While that may turn out to play a part here, I think the main problem is the formula you have posted uses a range between -1 and 1, and luma has a range between 0 and 1.

    So you need to correct either the range of luma (and change it back again afterwards) or change the formula to make work right in the 0 to 1 range.

    BTW - you wouldn't have happened to have found the right formula here, because that how far I got yesterday before I went to bed - If not then I commend you on your curvefitting skills - I haven't learned how to do that.
     
Thread Status:
Not open for further replies.

Share This Page