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

    Gramps Guest

    Messages:
    84
    Likes Received:
    0
    GPU:
    PNY GTX 770 4GB OC
    I would love to see a ENB/SweetFX combo from GTA:San Andreas :p Still my favourite game after so many years
     
  2. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    Some laptop have two graphics cards, a slow (but powersaving) one and a fast one.

    On some laptops SweetFX and similar mods runs on the slower card for some reason instead of the fast one.

    Some laptops have an option to disable the slower card in the BIOS - you could try and see if that's a possibility with the laptop you have.
     
  3. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    No - for the same reason.

    I need the injector to do this for me - It can't be done in the shader alone.
     
  4. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    Not all shaders. Some do, some don't.

    No I won't. The best way to do it is to first perform SMAA and then make a new pass that both reads and outputs to gamma-space, which can be done by sampling from colortexgamma and using a DXGI format without a SRGB postfix for that pass.

    There will be a degradation in quality if that pass is done in gamma-space, so you should use a SRGB texture for the output of the last SMAA pass.
    But if you could make another pass after that to run the SweetFX shaders in, that would output in gamma-space that would be best. Later on I will want to do even more passes, but for now let's just get it working right.

    Well there is an overhead to doing more passes, but if splitting the shader up in multiple passes means you can make do with far fewer texture lookups then it's worth it.
    The artifacts comes because I really should be sampling the output of the effect that came before, and not the original and I can only do this if the output of the previous effect was written out first.

    An example : First SMAA runs and does it's magic. Then Lumasharpen runs and samples the pixels around the current pixel and uses that to determine the sharpening. But Lumasharpen cannot read the anti-aliased output of SMAA when it does this because it has not been written yet. Only the current pixels anti-aliased value is available, not the pixels around it.
    So if I just read the center pixel and the pixels around that, I would overwrite all the work that SMAA had done.
    Instead what I do is another hack. I calculate the sharpening from the original pixel and the pixels around it, but then I add the sharpening not to the original pixel but to the output of the SMAA shader.
    This way I can still get some anti-aliasing even though it's now been blended in with the original image, which result in a less smooth look for the anti-aliasing.

    ? The dxgi.dll that comes with InjectSMAA is not DX10 or 11 specific but works with both. I got the impression that it's possible to do a version for both since both use DXGI. So not so much a DX10 or 11 injector but a DXGI injector.
    I'm also going to have to say yes - you should work on DX10 too. While many future games will come with DX11 there are still lots of DX10 and DX9 games coming out, and tons that already exists.
    Gotta catch them all!
     

  5. Sergio

    Sergio Guest

    Messages:
    254
    Likes Received:
    7
    GPU:
    Asus 760 DirectCU II OC
    Hi, is there a way combining SweetFx effects with F.lux please? F.lux never let me use Nvidia color contrast settings. Maybe there is a way to combine those ? Thanks.
     
  6. Elajitz

    Elajitz Master Guru

    Messages:
    775
    Likes Received:
    190
    GPU:
    GeForce RTX 4090


    Here you go! its only Sweetfx! No ENB added! http://sfx.thelazy.net/games/preset/316/
    hope you like it! :)

    [​IMG][​IMG]
     
  7. TCPIP

    TCPIP Guest

    Messages:
    67
    Likes Received:
    0
    GPU:
    AMD Radeon R9 290
    So, with the TVLevels shader working great, there is another shader i'd like to port to SweetFX - the adaptation shader, the idea came from a "feature" of AMD drivers - dynamic contrast for video content, which is actually good at some points, but could be a bit faster and the algorithm more adaptive, for example if there is snow in the movie, like big snowflakes passing the screen, it has some trouble adjusting and keeps going between different contrast ratios, which looks awfull.
    So this shader would look good for games that lack the adaptation mechanism - like Dishonoder, it could help with making the shadows more pronounced in a brighter environment, but still make it playable if you are in a dark tunnel or something because it would make the shadows brighter accordingly.
    But again, i lack the skills for making this shader work with SweetFX, or even making a new one.
    Here is what i found:
    Code:
    // Calculates adaptation to minimum/maximum luminance values,
    // based on "currently adapted" and "new values to adapt to"
    // textures (both 1x1).
    
    Shader "Hidden/Contrast Stretch Adaptation" {
    Properties {
    	_MainTex ("Base (RGB)", RECT) = "white" {}
    	_CurTex ("Base (RGB)", RECT) = "white" {}
    }
    
    Category {
    	SubShader {
    		Pass {
    			ZTest Always Cull Off ZWrite Off
    			Fog { Mode off }
    				
    CGPROGRAM
    #pragma vertex vert_img
    #pragma fragment frag
    #pragma fragmentoption ARB_precision_hint_fastest 
    #include "UnityCG.cginc"
    
    uniform samplerRECT _MainTex; // currently adapted to
    uniform samplerRECT _CurTex; // new value to adapt to
    uniform float4 _AdaptParams; // x=adaptLerp, y=limitMinimum, z=limitMaximum
    
    float4 frag (v2f_img i) : COLOR  {
    	// value is: max, min
    	float2 valAdapted = texRECT(_MainTex, i.uv).xy;
    	float2 valCur = texRECT(_CurTex, i.uv).xy;
    	
    	// Calculate new adapted values: interpolate
    	// from valAdapted to valCur by script-supplied amount.
    	//
    	// Because we store adaptation levels in a simple 8 bit/channel
    	// texture, we might not have enough precision - the interpolation
    	// amount might be too small to change anything, and we'll never
    	// arrive at the needed values.
    	//
    	// So we make sure the change we do is at least 1/255th of the
    	// color range - this way we'll always change the value.
    	const float kMinChange = 1.0/255.0;
    	float2 delta = (valCur-valAdapted) * _AdaptParams.x;
    	delta.x = sign(delta.x) * max( kMinChange, abs(delta.x) );
    	delta.y = sign(delta.y) * max( kMinChange, abs(delta.y) );
    
    	float4 valNew;
    	valNew.xy = valAdapted + delta;
    	
    	// Impose user limits on maximum/minimum values
    	valNew.x = max( valNew.x, _AdaptParams.z );
    	valNew.y = min( valNew.y, _AdaptParams.y );
    	
    	// Optimization so that our final apply pass is faster:
    	// z = max-min (plus a small amount to prevent division by zero)
    	valNew.z = valNew.x - valNew.y + 0.01;
    	// w = min/(max-min)
    	valNew.w = valNew.y / valNew.z;
    	
    	return valNew;
    }
    ENDCG
    
    		}
    	}
    }
    
    Fallback off
    
    }
    And, of course, there is the adaptation shader from ENB.
     
    Last edited: Apr 9, 2013
  8. GenericGamer

    GenericGamer Guest

    Messages:
    1
    Likes Received:
    0
    GPU:
    NVIDIA GTX 560 (1GB)
    Anyone know a way to make this work with other d3d9.dll injectors (specifically SoftTH)?
     
  9. Zomgerd

    Zomgerd Guest

    Messages:
    304
    Likes Received:
    0
    GPU:
    Asus R9 280X DC2T
    I think unless SoftTH has feature built in to allow a second d3d9.dll like enb (which it does not) then no it is not possible. Would be great if it did have such a feature, though I suppose if injectors had the option that would work to but I really have no idea what that would entail or if it wouldn't even work.
     
  10. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    I noticed something cool in the SweetFX Settings Database.

    The user Zefx have added a preset for Jedi Academy.
    That's an OpenGL game, but he used an OpenGL wrapper called GLDirect to make it work anyways.

    In other news the full source code for Jedi Academy was just released a few days ago.
     

  11. Gramps

    Gramps Guest

    Messages:
    84
    Likes Received:
    0
    GPU:
    PNY GTX 770 4GB OC
    How do you identify what a game uses? OpenGL/DirectX etc .. ?
     
  12. kaicooper

    kaicooper Guest

    Messages:
    519
    Likes Received:
    42
    GPU:
    GTX 780 SC ACX
    is there really good injector working for Openlg games?
    really wanna try it on Amnesia
     
  13. kaicooper

    kaicooper Guest

    Messages:
    519
    Likes Received:
    42
    GPU:
    GTX 780 SC ACX
    and is there anybody tried sweetfx with Max Payne 3?
    i did and stutter like HEEEEEEEEEEEEELL.. donno why
     
  14. QuadReaktor

    QuadReaktor Guest

    Messages:
    161
    Likes Received:
    0
    GPU:
    Gainward GTX680 2GB
    Read post 390 ;) Maybe it works.

    It looks damn nice ! THX for Share :)

    @CeeJay.dk
    Is it possible to implement a DOF option in future versions ? Would be so cool !!!
     
    Last edited: Apr 10, 2013
  15. Marcel

    Marcel Guest

    Messages:
    1,141
    Likes Received:
    0
    GPU:
    MSI GTX 1070 Gaming
    Another little problem with 1.4 version in Darksiders2. Screenshots are much darker than game. With fraps is all OK but fraps supported max resolution 2800x1600 and i want 4K for screenshots... some help?
     

  16. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
  17. CeeJay.dk

    CeeJay.dk Guest

    Messages:
    691
    Likes Received:
    14
    GPU:
    Radeon 6870
    No. Not without specific support for the game in the injector. I need a depth texture to determine how far from the player an object is so I can blur it appropriately.
     
  18. marcosamerio

    marcosamerio Master Guru

    Messages:
    727
    Likes Received:
    2
    GPU:
    ZOTA NVIDIA 1060
    Hi all ¿wich settings of i must tweak to get more brighter and less darker

    shadows?, the game is FarCry 2.

    /*-----------------------------------------------------------.
    / 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

    Bye all
     
  19. keenan

    keenan Ancient Guru

    Messages:
    1,613
    Likes Received:
    5
    GPU:
    EVGA 980Ti Hydro Copper
    Hi, I'm trying to get sweetfx running in dead space 1, but would also like to use the fxaa injector dlls with it..

    If I use the d3d9.dll from fxaa, then sweetfx preset doesnt load and if I use the d3d9.dll from sweetfx then the game doesnt start at all..

    Anyone know how to go about doing this?
     
  20. Dymblos

    Dymblos Guest

    Messages:
    41
    Likes Received:
    1
    GPU:
    GTX570

    not my notebook

    Only 1 dedicated Graphic Card

    GTX660M
     
Thread Status:
Not open for further replies.

Share This Page