diff options
Diffstat (limited to 'math.cginc')
| -rwxr-xr-x | math.cginc | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -100,5 +100,10 @@ float3 blendNormalsHill12(float3 n0, float3 n1) { return normalize(n0 * dot(n0, n1) - n1 * n0.z); } +// https://en.wikipedia.org/wiki/Relative_luminance +float luminance(float3 rgb) { + return dot(float3(0.2126, 0.7152, 0.0722), rgb); +} + #endif // __MATH_INC |
