From caf02458737f93b20978f41613ad5b56e074e154 Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 12 Feb 2025 01:24:49 -0800 Subject: Add a bunch of features * stereo instancing * outlines * shadows (casting & receiving) * unity fog * blend modes * wrapped lighting (generalized half lambertian) * diffuse & specular have independent knobs Also: * fix bug where shadow caster wouldn't clip in cutout mode. * remove a bunch of unused params * use ifex to minimize size of locked materials (more to be done probably) * improve formatting --- math.cginc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'math.cginc') 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 -- cgit v1.2.3