Skip to content

Instantly share code, notes, and snippets.

@joletb
Created January 11, 2018 18:02
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joletb/9c718eafb0249546d0f05737c7469efb to your computer and use it in GitHub Desktop.
Save joletb/9c718eafb0249546d0f05737c7469efb to your computer and use it in GitHub Desktop.
sampler s0 : register(s0);
#define const_1 ( 16.0 / 235.0)
#define const_2 (235.0 / 219.0)
float4 main(float2 tex : TEXCOORD0) : COLOR
{
// original pixel
float4 c0 = tex2D(s0, tex);
return ((c0 - const_1) * const_2);
}
@FichteFoll
Copy link

FichteFoll commented Jan 18, 2018

Here's a glsl version for mpv:

//!HOOK LUMA
//!BIND HOOKED
//!DESC Anti Kyoani Fog

#define const_1 ( 16.0 / 235.0)
#define const_2 (235.0 / 219.0)

vec4 hook() {
    return (LUMA_tex(LUMA_pos) - const_1) * const_2;
}

Save it to some file and specify it with --glsl-shaders-append=<path> on the command line.

@FichteFoll
Copy link

FichteFoll commented Jan 24, 2018

And since I just wrote it for someone else anyway, you can use this profile along with the auto-profiles script to have the shader automatically active only for Violet Evergarden:

[cuck_kyoani]
profile-desc=cond:string.match(p.filename, "Evergarden")~=nil
glsl-shaders-append=<path>

@FichteFoll
Copy link

Here's a comparison for how this looks with and without the shader: https://diff.pics/DIRD4kvAGVVv/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment