OpenGL ES Shinder for converting color images to black and white infrared?

I managed to create a fragmented shader to convert a color image to shades of gray using:

 float luminance = pixelColor.r * 0.299 + pixelColor.g * 0.587 + pixelColor.b * 0.114;
 gl_FragColor = vec4(luminance, luminance, luminance, 1.0);

Now I would like to imitate the effect of the mixer of the Photoshop channel:

Black & White Infrared

How to convert percentage values %(-70%, + 200%, -30%) to r g bfloating point numbers (e.g. 0.299, 0.587, 0.114)?

+3
source share
1 answer

You should know from school that 10% of a value means multiplying that value by 0.1, so just use it (-0.7, 2.0, -0.3).

+3
source

All Articles