summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'math.cginc')
-rwxr-xr-xmath.cginc5
1 files changed, 5 insertions, 0 deletions
diff --git a/math.cginc b/math.cginc
index 3d7e92e..e2d4169 100755
--- a/math.cginc
+++ b/math.cginc
@@ -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