summaryrefslogtreecommitdiffstats
path: root/yum_pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-06-22 21:58:47 -0700
committeryum <yum.food.vr@gmail.com>2025-06-22 21:58:47 -0700
commitc4aed2f2f1ba8f126d445f0c0b9367e032d24b54 (patch)
tree30ce2d61e6a2edfd0ed7bde1f5f6413aacc3103b /yum_pbr.cginc
parent8116b89e69b8206fec2e4975d84e59e33f30a25e (diff)
add oklch correction & decal mult 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)