summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x3ner.shader2
-rwxr-xr-xfeatures.cginc2
-rw-r--r--matcap.cginc6
3 files changed, 10 insertions, 0 deletions
diff --git a/3ner.shader b/3ner.shader
index ac67013..d3937bb 100755
--- a/3ner.shader
+++ b/3ner.shader
@@ -559,6 +559,7 @@ Shader "yum_food/3ner"
_Matcap0_Strength("Strength", Range(-10, 10)) = 1
[ThryWideEnum(Replace, 0, Add, 1, Multiply, 2, Subtract, 3, Add Product, 4)] _Matcap0_Mode("Mode", Int) = 0
[Toggle] _Matcap0_Invert("Invert", Float) = 0
+ [ThryToggle(_MATCAP0_ALBEDO_CLAMP)] _Matcap0_Albedo_Clamp("Clamp albedo", Float) = 0
//ifex _Matcap0_Quantization_Enabled==0
[HideInInspector] m_start_Matcap0_Quantization("Quantization", Float) = 0
@@ -583,6 +584,7 @@ Shader "yum_food/3ner"
_Matcap1_Strength("Strength", Range(-10, 10)) = 1
[ThryWideEnum(Replace, 0, Add, 1, Multiply, 2, Subtract, 3, Add Product, 4)] _Matcap1_Mode("Mode", Int) = 0
[Toggle] _Matcap1_Invert("Invert", Float) = 0
+ [ThryToggle(_MATCAP1_ALBEDO_CLAMP)] _Matcap1_Albedo_Clamp("Clamp albedo", Float) = 0
//ifex _Matcap1_Quantization_Enabled==0
[HideInInspector] m_start_Matcap1_Quantization("Quantization", Float) = 0
diff --git a/features.cginc b/features.cginc
index e826c72..9caebf1 100755
--- a/features.cginc
+++ b/features.cginc
@@ -219,12 +219,14 @@
#pragma shader_feature_local _MATCAP0
#pragma shader_feature_local _MATCAP0_QUANTIZATION
#pragma shader_feature_local _MATCAP0_MASK
+#pragma shader_feature_local _MATCAP0_ALBEDO_CLAMP
//endex
//ifex _Matcap1_Enabled==0
#pragma shader_feature_local _MATCAP1
#pragma shader_feature_local _MATCAP1_QUANTIZATION
#pragma shader_feature_local _MATCAP1_MASK
+#pragma shader_feature_local _MATCAP1_ALBEDO_CLAMP
//endex
//ifex _Rim_Lighting0_Enabled==0
diff --git a/matcap.cginc b/matcap.cginc
index 150ed98..537e62a 100644
--- a/matcap.cginc
+++ b/matcap.cginc
@@ -81,6 +81,9 @@ void apply_matcaps_and_rim_lighting(v2f i, inout Pbr pbr, inout LightData light_
float m0_mask = 1;
#endif
applyMatcap(pbr, m0, _Matcap0_Mode, m0_mask);
+#if defined(_MATCAP0_ALBEDO_CLAMP)
+ pbr.albedo.rgb = saturate(pbr.albedo.rgb);
+#endif
#endif // _MATCAP0
#if defined(_MATCAP1)
@@ -98,6 +101,9 @@ void apply_matcaps_and_rim_lighting(v2f i, inout Pbr pbr, inout LightData light_
float m1_mask = 1;
#endif
applyMatcap(pbr, m1, _Matcap1_Mode, m1_mask);
+#if defined(_MATCAP1_ALBEDO_CLAMP)
+ pbr.albedo.rgb = saturate(pbr.albedo.rgb);
+#endif
#endif // _MATCAP1
#if defined(_RIM_LIGHTING0)