Question Is there a parameter to make the image sharper?

Discussion in 'Community Support' started by OlivierMDVY, Jul 20, 2019.

  1. OlivierMDVY

    OlivierMDVY Active Member

    Joined:
    Jan 29, 2015
    Ratings:
    +27 / 0 / -0
    Maybe a parameter in a config file?
    Thanks.
     
  2. Georg Ortner

    Georg Ortner KW Studios Developer

    Joined:
    Jan 13, 2015
    Ratings:
    +3,507 / 0 / -0
    Try turning off FXAA, that will make the image a lot crisper.

    You could also look into www.reshade.me
    It has a bunch of sharpening options ("clarity" shader works well for me)
     
    • Like Like x 3
    • Agree Agree x 2
  3. Hervé45

    Hervé45 Well-Known Member Beta tester

    Joined:
    Jan 25, 2017
    Ratings:
    +135 / 0 / -0
    Thanks
     
  4. OlivierMDVY

    OlivierMDVY Active Member

    Joined:
    Jan 29, 2015
    Ratings:
    +27 / 0 / -0
    Does it work in VR? Because I can't see any difference
     
  5. Goffik

    Goffik Well-Known Member

    Joined:
    Jun 30, 2017
    Ratings:
    +170 / 0 / -0
    I don't notice a great deal of difference with FXAA on/off in VR either. Also, as far as I'm aware Reshade doesn't work at all for VR so that isn't an option. :(
     
  6. RWB 3vil

    RWB 3vil Active Member

    Joined:
    Dec 5, 2018
    Ratings:
    +41 / 0 / -0
    @Georg Ortner

    Can we add/increase sharpening via the .fx files in Game\Shaders\dx9\fx

    I see there is a pre and postsharpen.fx file . If we alter these will the game accept the changes or are they hard coded and will cause errors if the values are altered?

    Also are any of the moods, less intensive than the default so for example do any of the other moods have less post fx enabled ( for better VR performance) and are you going to add a way to be able to select them via a menu option of some kind as there are several fx templates or "moods" as you call them that sit there doing nothing and I imagine not many people even know about them.
     
  7. Case

    Case Well-Known Member

    Joined:
    Apr 7, 2017
    Ratings:
    +104 / 0 / -0
    @RWB 3vil Moods are long deprecated remnants of some early attempts at different time of day if I'm not mistaken.
     
  8. RWB 3vil

    RWB 3vil Active Member

    Joined:
    Dec 5, 2018
    Ratings:
    +41 / 0 / -0
    Indeed, Im trying the realistic mood in Vr. looks ace.

    But I would love to hear from the devs if tweaking the pre and post sharpening fx file is possible to make vr a bit crisper and how to do it as the details inside the file (via notepad++) are quite confusing

    example :

    float Sharpen = 0.014;

    float4 PostSharpenPass( float4 orig, float2 tex )
    {
    float4 color;
    color = 9.0 * orig;
    color -= tex2D( s0, tex.xy + float2(px, py));
    color -= tex2D( s0, tex.xy + float2(0, py));
    color -= tex2D( s0, tex.xy + float2(-px, py));
    color -= tex2D( s0, tex.xy + float2(-px, 0));
    color -= tex2D( s0, tex.xy + float2(-px, -py));
    color -= tex2D( s0, tex.xy + float2(0, -py));
    color -= tex2D( s0, tex.xy + float2(px, -py));
    color -= tex2D( s0, tex.xy + float2(px, 0));
    color = color * Sharpen + (1.0 - Sharpen) * orig;
    color.a = orig.a;
    return color;
    }

    Pre sharpen

    /*------------------------------------------------------------------------------
    PRE_SHARPEN
    ------------------------------------------------------------------------------*/
    float AverageBlur = 0.45;
    float SharpenEdge = 0.405;
    float SharpenContour = 0.095;
    float CoefficientsBlur = 1.5997;
    float CoefficientsOriginal = 2.5997;
    bool highQualitySharpen = 0;

    #define dx ((AverageBlur * 0.05)*px)
    #define dy ((AverageBlur * 0.05)*py)

    float4 SharpenPass( float2 tex )
    {
    // Recover the original pixels
    float4 Original = tex2D(s0, tex);
    // Gaussian filter
    // [ 1, 2 , 1 ]
    // [ 2, 4 , 2 ]
    // [ 1, 2 , 1 ]
    float4 c1 = tex2D(s0, tex + float2(-dx,-dy));
    float4 c2 = tex2D(s0, tex + float2(0,-dy));
    float4 c3 = tex2D(s0, tex + float2(dx,-dy));
    float4 c4 = tex2D(s0, tex + float2(-dx,0));
    float4 c5 = tex2D(s0, tex + float2(dx,0));
    float4 c6 = tex2D(s0, tex + float2(-dx,dy));
    float4 c7 = tex2D(s0, tex + float2(0,dy));
    float4 c8 = tex2D(s0, tex + float2(dx,dy));
    //Normalize the values. Formula: 1 / (1+2+1+2+4+2+1+2+1) = 1 / 16 = .0625
    float4 blur = (c1+c3+c6+c8 + 2*(c2+c4+c5+c7)+ 4*Original)*0.0625;
    //Subtracting the blurred image from the original image
    float4 Corrected = CoefficientsOriginal*Original - CoefficientsBlur*blur;
    //For higher precision in the calculation of contour, requires slightly more processing power
    // [ c1, c2 , c3 ]
    // [ c4, ori , c5 ]
    // [ c6, c7 , c8 ]
    if (highQualitySharpen == true)
    {
    c1 = tex2D(s0, tex + float2(-px,-py));
    c2 = tex2D(s0, tex + float2(0,-py));
    c3 = tex2D(s0, tex + float2(px,-py));
    c4 = tex2D(s0, tex + float2(-px,0));
    c5 = tex2D(s0, tex + float2(px,0));
    c6 = tex2D(s0, tex + float2(-px,py));
    c7 = tex2D(s0, tex + float2(0,py));
    c8 = tex2D(s0, tex + float2(px,py));
    }
    else {}
    // Horizontal gradient
    // [ -1, 0 ,1 ]
    // [ -2, 0, 2 ]
    // [ -1, 0 ,1 ]
    float delta1 = (c3 + 2*c5 + c8)-(c1 + 2*c4 + c6);
    // Vertical gradient
    // [ -1,- 2,-1 ]
    // [ 0, 0, 0 ]
    // [ 1, 2, 1 ]
    float delta2 = (c6 + 2*c7 + c8)-(c1 + 2*c2 + c3);
    // Calculate and sharpen the blurry edges
    if (sqrt( mul(delta1,delta1) + mul(delta2,delta2)) > SharpenEdge)
    {
    // Contour sharpening
    return Original * CoefficientsBlur - (c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 ) * SharpenContour;
    }
    else
    {
    // Return corrected image
    return Corrected;
    }
    }
     
  9. MattYKee

    MattYKee Active Member

    Joined:
    May 16, 2019
    Ratings:
    +28 / 0 / -0
    Do you have a AMD graphics card?
    Turning on Virtual Super resolution in radeon control panel works wonders for me (though im not using VR).
     
  10. OtterNas3

    OtterNas3 Well-Known Member

    Joined:
    Jan 9, 2018
    Ratings:
    +315 / 0 / -0
    At least from all my test, these files do not change anything.