diff options
| author | yum <yum.food.vr@gmail.com> | 2024-12-25 20:30:14 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-01-22 21:07:06 -0800 |
| commit | 690f824533db02ecf9ac7e2a5672c0c84c5d1c1d (patch) | |
| tree | f82cf1dd878b3dc90382ba5b49096da31e70f88e /math.cginc | |
| parent | 358c53eb9ffae8da890fdc7ff10952bf3958819d (diff) | |
Tweak clearcoat
Diffstat (limited to 'math.cginc')
| -rw-r--r-- | math.cginc | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -300,5 +300,12 @@ uint gcd(uint a, uint b) return 1; } +float wrapNoL(float NoL, float factor) { + // Apply wrapped lighting correction + // https://www.iro.umontreal.ca/~derek/files/jgt_wrap_final.pdf + //float4 wrapped = (NoL + 1) * (NoL + 1) * .25; + return pow(max(1E-4, (NoL + factor) / (1 + factor)), 1 + factor); +} + #endif // __MATH_INC |
