Black, White and Red shader?

darrigaz

  • Posts: 124
Anyone able to recommend a way to set up a black white and red shader? Eg greyscale with red as the only colour still visible?

Sorta standard film noiry thing?

darrigaz

  • Posts: 124
No one? I managed to get the rough effect using this website and a lot of tinkering

http://pixelshaders.com/editor/

precision mediump float;

varying vec2 position;
uniform sampler2D webcam;

void main() {
  vec2 p = position;
  vec4 color = texture2D(webcam, p);
  gl_FragColor = color;
 
 
  if ((gl_FragColor.r <= 0.6) || (gl_FragColor.r >= 0.8))
  {
  gl_FragColor.r = (gl_FragColor.r);
  gl_FragColor.g = (gl_FragColor.r);
  gl_FragColor.b = (gl_FragColor.r);
  gl_FragColor.a = gl_FragColor.a;
  }
 
  else
  {
     gl_FragColor.r = 0.7;
  }
}

No idea how to carry that over to the custom shader code block though...