Created
July 13, 2020 20:46
-
-
Save pingpoli/2c965d29713d110de5f2a7fdbeaf3e2f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 330 core | |
in vec2 uv; | |
uniform sampler2D sampler; | |
uniform float desaturationFactor; | |
out vec4 fragColor; | |
void main() | |
{ | |
vec3 color = texture2D( sampler , uv ).rgb; | |
vec3 gray = vec3( dot( color , vec3( 0.2126 , 0.7152 , 0.0722 ) ) ); | |
fragColor = vec4( mix( color , gray , desaturationFactor ) , 1.0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment