diff options
| author | yum <yum.food.vr@gmail.com> | 2025-03-20 18:57:24 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-03-20 18:57:24 -0700 |
| commit | b377dd05175d5bffaeef9c55051cd396c127daef (patch) | |
| tree | f868dbd0da08ac1d914e7d6c3fa8a7718bfc83af /math.cginc | |
| parent | ee3db7ea6f80e31e31958848b5138e2a5c848af5 (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.cginc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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
|
