summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'yum_pbr.cginc')
-rw-r--r--yum_pbr.cginc6
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)