summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc5
1 files changed, 5 insertions, 0 deletions
diff --git a/math.cginc b/math.cginc
index a12040a..17ce86f 100644
--- a/math.cginc
+++ b/math.cginc
@@ -10,6 +10,11 @@ float pow5(float x)
return (tmp * tmp) * x;
}
+float wrapNoL(float NoL, float factor) {
+ // https://www.iro.umontreal.ca/~derek/files/jgt_wrap_final.pdf
+ return pow(max(1E-4, (NoL + factor) / (1 + factor)), 1 + factor);
+}
+
#endif // __MATH_INC