summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc6
1 files changed, 6 insertions, 0 deletions
diff --git a/math.cginc b/math.cginc
index 414f618..8edbc88 100644
--- a/math.cginc
+++ b/math.cginc
@@ -17,6 +17,12 @@ float wrapNoL(float NoL, float factor) {
return pow(max(1E-4, (NoL + factor) / (1 + factor)), 1 + factor);
}
+float halfLambertianNoL(float NoL) {
+ // https://www.iro.umontreal.ca/~derek/files/jgt_wrap_final.pdf
+ float tmp = (NoL + 1) * 0.5;
+ return tmp * tmp;
+}
+
float rand1(float p)
{
return frac(sin(p) * 43758.5453123);