summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'yum_pbr.cginc')
-rw-r--r--yum_pbr.cginc9
1 files changed, 9 insertions, 0 deletions
diff --git a/yum_pbr.cginc b/yum_pbr.cginc
index c3f5c4a..03026c3 100644
--- a/yum_pbr.cginc
+++ b/yum_pbr.cginc
@@ -8,6 +8,7 @@
#include "glitter.cginc"
#include "globals.cginc"
#include "math.cginc"
+#include "oklab.cginc"
#include "texture_utils.cginc"
struct YumPbr {
@@ -134,6 +135,14 @@ YumPbr GetYumPbr(v2f i, float3x3 tangentToWorld) {
applyDecals(i, result.albedo, normal_tangent, result.metallic, result.smoothness);
propagateRoughness(result.smoothness, result.roughness_perceptual, result.roughness);
+#if defined(_OKLCH_CORRECTION)
+ float3 lch = LRGBtoOKLCH(result.albedo.rgb);
+ lch.x = lch.x * _Oklch_Correction_L;
+ lch.y = lch.y * _Oklch_Correction_C;
+ lch.z = lch.z * _Oklch_Correction_H;
+ result.albedo.rgb = OKLCHtoLRGB(lch);
+#endif
+
result.normal = normalize(mul(normal_tangent, tangentToWorld));
#if (defined(FORWARD_BASE_PASS) || defined(FORWARD_ADD_PASS)) && defined(_GLITTER)