From b377dd05175d5bffaeef9c55051cd396c127daef Mon Sep 17 00:00:00 2001 From: yum Date: Thu, 20 Mar 2025 18:57:24 -0700 Subject: 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. --- yum_lighting.cginc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yum_lighting.cginc') diff --git a/yum_lighting.cginc b/yum_lighting.cginc index 23e360e..0b4e077 100644 --- a/yum_lighting.cginc +++ b/yum_lighting.cginc @@ -231,11 +231,11 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { #endif #if defined(_QUANTIZE_SPECULAR) - float specular_luminance = dot(light.specular, float3(0.2126, 0.7152, 0.0722)); // convert to luminance + float specular_luminance = luminance(light.specular); light.specular = light.specular * floor(specular_luminance * _Quantize_Specular_Steps) / _Quantize_Specular_Steps; #endif #if defined(_QUANTIZE_DIFFUSE) - float diffuse_luminance = dot(light.diffuse, float3(0.2126, 0.7152, 0.0722)); // convert to luminance + float diffuse_luminance = luminance(light.diffuse); light.diffuse = light.diffuse * floor(diffuse_luminance * _Quantize_Diffuse_Steps) / _Quantize_Diffuse_Steps; #endif -- cgit v1.2.3