Skip to content

Instantly share code, notes, and snippets.

@ykro
Created June 4, 2024 13:05
Show Gist options
  • Save ykro/ac79d329af585e0938120e9c9f58b610 to your computer and use it in GitHub Desktop.
Save ykro/ac79d329af585e0938120e9c9f58b610 to your computer and use it in GitHub Desktop.
Grayscale Visual Blocks
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