Created
June 4, 2024 13:05
-
-
Save ykro/ac79d329af585e0938120e9c9f58b610 to your computer and use it in GitHub Desktop.
Grayscale Visual Blocks
This file contains 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
float greyScale(in vec3 col) { | |
return dot(col, vec3(0.2126, 0.7152, 0.0722)); | |
} | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ){ | |
vec2 q = fragCoord.xy / iResolution.xy; | |
vec3 col = texture(iChannel0, q).rgb; | |
vec3 res = vec3(greyScale(col)); | |
fragColor = vec4(res, 1.0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment