diff options
| author | yum <yum.food.vr@gmail.com> | 2025-04-08 17:52:52 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-04-08 17:52:52 -0700 |
| commit | 40c33d438afa036acfcbc58ca4078f25db1624f2 (patch) | |
| tree | 045d3d3b44e785ad7d8fbaaa2ec874585a5d9773 /math.cginc | |
| parent | 2dfd6322587eb095a5a4f7b22d70e1abcc14d5e3 (diff) | |
Add static flag to limit fallback cubemap to metallic
Diffstat (limited to 'math.cginc')
| -rw-r--r-- | math.cginc | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -16,10 +16,10 @@ float pow5(float x) }
float wrapNoL(float NoL, float k) {
-#if 0
+#if 1
// https://www.iro.umontreal.ca/~derek/files/jgt_wrap_final.pdf
return pow(max(1E-4, (NoL + k) / (1 + k)), 1 + k);
-#else
+#else
float k_sq = k * k;
float b = max(0, lerp(NoL, 1.0, k));
float p = -6.0 * k_sq + 5.0 * k + 1.0;
@@ -27,7 +27,7 @@ float wrapNoL(float NoL, float k) { float F = pow(b, p);
// Approximate integral of NoL with respect to theta
- float I = 0.7856 * k_sq - 0.2148 * k + 1.0;
+ float I = (0.7856 * k_sq - 0.2148 * k) + 1.0;
float G = F / max(I, 1E-6);
|
