Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created August 22, 2015 18:22
Show Gist options
  • Save unitycoder/f0b0074ed3679caf6717 to your computer and use it in GitHub Desktop.
Save unitycoder/f0b0074ed3679caf6717 to your computer and use it in GitHub Desktop.
Threshold color values in Shader
// https://github.com/genekogan/Processing-Shader-Examples/blob/master/TextureShaders/data/threshold.glsl
float bright = 0.33333 * (color.r + color.g + color.b);
float b = lerp(0.0, 1.0, step(0.1, bright));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment