Sha256: 908067dafa75041ac278a45d096ef3f37cc507f185aaf72353eb0887a6ec2531
Contents?: true
Size: 442 Bytes
Versions: 12
Compression:
Stored size: 442 Bytes
Contents
/** * Computes the luminance of a color. * * @name czm_luminance * @glslFunction * * @param {vec3} rgb The color. * * @returns {float} The luminance. * * @example * float light = czm_luminance(vec3(0.0)); // 0.0 * float dark = czm_luminance(vec3(1.0)); // ~1.0 */ float czm_luminance(vec3 rgb) { // Algorithm from Chapter 10 of Graphics Shaders. const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); }
Version data entries
12 entries across 12 versions & 1 rubygems