summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbrdf.cginc3
-rwxr-xr-xpbr.cginc2
2 files changed, 3 insertions, 2 deletions
diff --git a/brdf.cginc b/brdf.cginc
index 1e920bb..0ce723c 100755
--- a/brdf.cginc
+++ b/brdf.cginc
@@ -96,8 +96,7 @@ float4 brdf(Pbr pbr, LightData data) {
#if defined(_CLEARCOAT)
const float cc_f0 = 0.04f;
- float cc_perceptual_roughness = saturate(sqrt(pbr.cc_roughness));
- float2 cc_dfg_uv = float2(data.common.NoV_cc, cc_perceptual_roughness);
+ float2 cc_dfg_uv = float2(data.common.NoV_cc, pbr.cc_roughness_perceptual);
float3 cc_dfg;
[branch]
if (textureExists(_DFG_LUT)) {
diff --git a/pbr.cginc b/pbr.cginc
index be67501..a01c185 100755
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -24,6 +24,7 @@ struct Pbr {
#endif
#if defined(_CLEARCOAT)
float cc_roughness;
+ float cc_roughness_perceptual;
float cc_strength;
#endif
#if defined(_IMPOSTORS_DEPTH)
@@ -228,6 +229,7 @@ Pbr getPbr(v2f i) {
#if defined(_CLEARCOAT)
pbr.cc_roughness = _Clearcoat_Roughness;
+ pbr.cc_roughness_perceptual = sqrt(pbr.cc_roughness);
pbr.cc_strength = _Clearcoat_Strength;
#endif
propagateSmoothness(pbr);