glsl-luma
Get the luma (brightness) of an RGB color in GLSL. Useful for converting images to greyscale.
Usage
float value = luma(vec3 rgb)
float value = luma(vec4 rgba)
Takes a vec3
or vec4
color as input, returning the luma as a float
.
precision mediump float;uniform sampler2D uTexture;varying vec2 vUv;# luma = require(glsl-luma)void
License
MIT. See LICENSE.md for details.