diff options
| author | yum <yum.food.vr@gmail.com> | 2026-07-20 18:19:07 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-07-20 18:19:07 -0700 |
| commit | 0aa2636033ce27156c387b5cfbb19ed4ca29d12a (patch) | |
| tree | 12f03b580cf6881dc747f2e3e7c5a7291067f120 | |
| parent | b7d6ad400c41fcc0608e2dc15ec45d3692d82f16 (diff) | |
Clanker light volumes fixes
| -rwxr-xr-x | brdf.cginc | 14 | ||||
| -rwxr-xr-x | lighting.cginc | 2 |
2 files changed, 14 insertions, 2 deletions
@@ -7,6 +7,7 @@ #include "pema99.cginc" #include "pbr.cginc" #include "glitter.cginc" +#include "poi.cginc" float pow5(float x) { float x2 = x * x; @@ -284,9 +285,20 @@ float4 brdf(v2f i, Pbr pbr, LightData data, out BrdfData bd) { { [branch] if (_UdonLightVolumeEnabled) { - specular += LightVolumeSpecular(pbr.albedo.xyz, pbr.smoothness, + float3 light_volume_specular = LightVolumeSpecular(pbr.albedo.xyz, pbr.smoothness, pbr.metallic, pbr.normal, data.common.V, data.indirect.L00, data.indirect.L01r, data.indirect.L01g, data.indirect.L01b); + +#if defined(_BRIGHTNESS_CLAMP) + float3 light_volume_specular_hsv = RGBtoHSV(light_volume_specular); + light_volume_specular_hsv[2] = clamp(light_volume_specular_hsv[2], 0, _Brightness_Clamp_Max); + light_volume_specular = HSVtoRGB(light_volume_specular_hsv); +#endif +#if defined(_BRIGHTNESS_MULTIPLIER) + light_volume_specular *= _Brightness_Multiplier; +#endif + + specular += light_volume_specular; } } #endif diff --git a/lighting.cginc b/lighting.cginc index db9cee0..835613e 100755 --- a/lighting.cginc +++ b/lighting.cginc @@ -144,7 +144,7 @@ float4 getIndirectDiffuse(v2f i, Pbr pbr, inout LightData light) { #if defined(_BENT_NORMALS) diffuse.xyz += max(0, yumSH9(float4(pbr.bent_normal, 1.0), i.worldPos, light.indirect)); #else - diffuse.xyz += max(0, yumSH9(float4(i.normal, 1.0), i.worldPos, light.indirect)); + diffuse.xyz += max(0, yumSH9(float4(pbr.normal, 1.0), i.worldPos, light.indirect)); #endif #endif |
