integrate a color correction shader into reshade.

More
7 years 4 days ago - 7 years 2 days ago #1 by sucht
how can i integrate this shader into reshade?

Warning: Spoiler!


sorry if i had to ask the question elsewhere, but i would like to use it in my games.
i found it some years ago on AVSforum i think, and used it for MPC-HC back in the days and just found it on my HDD, it came as a Excel document.


ciao
sucht
Last edit: 7 years 2 days ago by sucht. Reason: corrected the shader code.

Please Log in or Create an account to join the conversation.

More
7 years 2 days ago - 7 years 2 days ago #2 by Marty McFly
Replied by Marty McFly on topic integrate a color correction shader into reshade.
That matrix is weird. it mixes commas as numeric components and to separate numbers so I had a little of guesswork. But the final shader actually seems to do nothing at all because the color changes done with this matrix are too low to notice. It's like this "double your age. Add 10. Subtract your age. Subtract 10. That's your age" it is some math but in the end everything cancels itself.
Last edit: 7 years 2 days ago by Marty McFly.

Please Log in or Create an account to join the conversation.

More
7 years 2 days ago - 7 years 2 days ago #3 by sucht
after calibrating my TV, and put in the numbers i got after calibrating into the excel file, it changed it into these long numbers you see in the shader code, and then i put this code into MPC-HC and it did work quite good.

but like i said i just found it after some years and thought i ask the PROS ;)

thank you for your time, and sorry for my english ;)

edit: i actually found the link to this on AVSForum
oh and the problem with the commas was made by the excel document giving me the final shader, i gave the shader a go and saw immediately what you meant(MPC-HC could not compile the shader). *sorry for that*
Last edit: 7 years 2 days ago by sucht.

Please Log in or Create an account to join the conversation.

More
7 years 2 days ago - 7 years 2 days ago #4 by crosire
Pretty much just copied your code:
sampler s0 : COLOR;

static float4x4 r2r =
{
1.40412014946264, -0.432440054809338, -0.00654217784142042, 0,
-0.0220921261148502, 1.02509523355613, 0.00195869854351983, 0,
-0.00551581309739748, 0.03912862385936, 1.01991796272781, 0,
0, 0, 0, 0
};

float4 main(float4 pos : POSITION, float2 tex : TEXCOORD0) : COLOR
{
    float4 c0 = tex2D(s0, tex);
    c0 = pow(c0, 1/0.45);
    c0 = mul(r2r, c0);
    c0 = saturate(c0);
    c0 = pow(c0, 0.45);

    return c0;
}

technique MyColorCorrectionShader
{
    pass
    {
        VertexShader = ...; // Use the vertex shader from the ReShade Framework for instance
        PixelShader = main;
    }
}
Last edit: 7 years 2 days ago by crosire.
The following user(s) said Thank You: sucht

Please Log in or Create an account to join the conversation.

More
7 years 2 days ago #5 by sucht

Pretty much just copied your code:
sampler s0 : COLOR;

static float4x4 r2r =
{
1.40412014946264, -0.432440054809338, -0.00654217784142042, 0,
-0.0220921261148502, 1.02509523355613, 0.00195869854351983, 0,
-0.00551581309739748, 0.03912862385936, 1.01991796272781, 0,
0, 0, 0, 0
};

float4 main(float4 pos : POSITION, float2 tex : TEXCOORD0) : COLOR
{
    float4 c0 = tex2D(s0, tex);
    c0 = pow(c0, 1/0.45);
    c0 = mul(r2r, c0);
    c0 = saturate(c0);
    c0 = pow(c0, 0.45);

    return c0;
}

technique MyColorCorrectionShader
{
    pass
    {
        VertexShader = ...; // Use the vertex shader from the ReShade Framework for instance
        PixelShader = main;
    }
}


thank you very much kind Sir ;)

Please Log in or Create an account to join the conversation.