diff options
| author | yum <yum.food.vr@gmail.com> | 2025-06-30 09:25:46 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-06-30 09:26:13 -0700 |
| commit | 7db318d2903ad993c618f551c455ec30c131d194 (patch) | |
| tree | 75f82a11a7841ad7d4e5a2c4c9a6a13e86c88635 /yum_pbr.cginc | |
| parent | 31bba649de265dd83ea1af638c03d224696d07b3 (diff) | |
Add oklab color clamp & fix light volumes shading
Diffstat (limited to 'yum_pbr.cginc')
| -rw-r--r-- | yum_pbr.cginc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/yum_pbr.cginc b/yum_pbr.cginc index 76383c0..08bdd67 100644 --- a/yum_pbr.cginc +++ b/yum_pbr.cginc @@ -140,6 +140,12 @@ YumPbr GetYumPbr(v2f i, float3x3 tangentToWorld) { result.albedo.rgb = OKLCHtoLRGB(lch); #endif +#if defined(_OKLAB_BRIGHTNESS_CLAMP) + float3 lab = LRGBtoOKLAB(result.albedo.rgb); + lab.x = clamp(lab.x, _Oklab_Brightness_Clamp_Min, _Oklab_Brightness_Clamp_Max); + result.albedo.rgb = OKLABtoLRGB(lab); +#endif + result.normal = normalize(mul(normal_tangent, tangentToWorld)); #if (defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS)) && defined(_GLITTER) |
