summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-03-20 18:57:24 -0700
committeryum <yum.food.vr@gmail.com>2025-03-20 18:57:24 -0700
commitb377dd05175d5bffaeef9c55051cd396c127daef (patch)
treef868dbd0da08ac1d914e7d6c3fa8a7718bfc83af /math.cginc
parentee3db7ea6f80e31e31958848b5138e2a5c848af5 (diff)
Add false color visualizer
Based on Sotalo's Furality talk - I wanted a way to visualize when my albedo is outside the recommended [0.025, 90]% brightness range. This feature does that. Dark is rendered red, bright is rendered blue.
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc6
1 files changed, 4 insertions, 2 deletions
diff --git a/math.cginc b/math.cginc
index 436cc56..2f05054 100644
--- a/math.cginc
+++ b/math.cginc
@@ -194,6 +194,8 @@ float3 blendNormalsHill12(float3 n0, float3 n1) {
return normalize(n0 * dot(n0, n1) - n1 * n0.z);
}
-#endif // __MATH_INC
-
+float3 luminance(float3 color) {
+ return dot(color, float3(0.2126, 0.7152, 0.0722));
+}
+#endif // __MATH_INC