- Home /
Question by
Nemox · Nov 03, 2014 at 04:22 PM ·
shadercolorbrightness
Shaders: Brightness of a colour?
I want to get a singular value for the brightness of a colour. Basically I want to take _Reflection.rgb and turn it into a single float value. Black would be 0, white would be 1.
Is there a function for this?
Comment
Answer by _dns_ · Nov 03, 2014 at 04:37 PM
Hi, getting the luminance of a color is the same as converting to black and white (I assume brightness = luminance)
l = color.r * 0.3 + color.g * 0.59 + color.b * 0.11