summaryrefslogtreecommitdiffstats
path: root/yum_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-02-20 18:48:18 -0800
committeryum <yum.food.vr@gmail.com>2025-02-20 18:48:18 -0800
commit14cdf12e17d2b17676135457e42bde391ff3f313 (patch)
treec1a9d73cc0e3daed83b2d2c3e005284e0cbfaeab /yum_lighting.cginc
parent01eeb68639ee4e3a5aeacf321c35a46c7dfe5c3d (diff)
Add emission, fine-tune quantized specular
Diffstat (limited to 'yum_lighting.cginc')
-rw-r--r--yum_lighting.cginc7
1 files changed, 4 insertions, 3 deletions
diff --git a/yum_lighting.cginc b/yum_lighting.cginc
index a7cb4ab..758fdb2 100644
--- a/yum_lighting.cginc
+++ b/yum_lighting.cginc
@@ -141,14 +141,15 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) {
light.diffuse = light.diffuse * floor(diffuse_luminance * _Quantize_Diffuse_Steps) / _Quantize_Diffuse_Steps;
#endif
- light.NoL = saturate(dot(pbr.normal, light.dir));
+ light.NoL = dot(pbr.normal, light.dir);
#if defined(_QUANTIZE_NOL)
light.NoL = floor(light.NoL * _Quantize_NoL_Steps) / _Quantize_NoL_Steps;
#endif
#if defined(_WRAPPED_LIGHTING)
- light.NoL_wrapped_s = wrapNoL(light.NoL, _Wrap_NoL_Specular_Strength);
- light.NoL_wrapped_d = wrapNoL(light.NoL, _Wrap_NoL_Diffuse_Strength);
+ light.NoL_wrapped_s = saturate(wrapNoL(light.NoL, _Wrap_NoL_Specular_Strength));
+ light.NoL_wrapped_d = saturate(wrapNoL(light.NoL, _Wrap_NoL_Diffuse_Strength));
#endif
+ light.NoL = saturate(light.NoL);
light.attenuation = getShadowAttenuation(i);