Skip to content

Instantly share code, notes, and snippets.

@FauxFaux
Created December 27, 2017 01:07
Show Gist options
  • Save FauxFaux/fd857e7f5a0cb76a3393eb17fda8f592 to your computer and use it in GitHub Desktop.
Save FauxFaux/fd857e7f5a0cb76a3393eb17fda8f592 to your computer and use it in GitHub Desktop.
compton compositor compatible code for colour correction
/* compton --backend glx --glx-fshader-win "$(cat ~/compton-colour.glsl)" */
uniform sampler2D tex;
/*mProtanopia*/
//static const half3 blindVisionR = float3( 0.20 , 0.99 , -0.19 );
//static const half3 blindVisionG = float3( 0.16 , 0.79 , 0.04 );
//static const half3 blindVisionB = float3( 0.01 , -0.01 , 1.00 );
/*mDeuteranopia*/
//static const half3 blindVisionR = float3( 0.43 , 0.72 , -0.15 );
//static const half3 blindVisionG = float3( 0.34 , 0.57 , 0.09 );
//static const half3 blindVisionB = float3(-0.02 , 0.03 , 1.00 );
/*mTritanopia*/
//static const half3 blindVisionR = float3( 0.97 , 0.11 , -0.08 );
//static const half3 blindVisionG = float3( 0.02 , 0.82 , 0.16 );
//static const half3 blindVisionB = float3( -0.06 , 0.88 , 0.18 );
/*mDogVision*/
static const half3 blindVisionR = float3( 0.32 , 0.85 , -0.17 );
static const half3 blindVisionG = float3( 0.25 , 0.68 , 0.07 );
static const half3 blindVisionB = float3( -0.01 , 0.01 , 1.00 );
void main()
{
vec4 fragColor = texture2D(tex, gl_TexCoord[0]);
fragColor = vec4(dot(fragColor, blindVisionR), dot(fragColor, blindVisionG), dot(fragColor, blindVisionB), fragColor.a);
gl_FragColor = fragColor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment