diff options
| author | yum <yum.food.vr@gmail.com> | 2025-02-20 00:07:46 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-02-20 00:07:46 -0800 |
| commit | 65ed0c23335b10a266d76257eeb3e7ecfd23cfb5 (patch) | |
| tree | 998424873ee3389894ee085ea6464b59a71474fb /math.cginc | |
| parent | cba7e1ab0bfa89b228955e18b47cf7aca2a84c9f (diff) | |
Add directionality and quantization to rim lighting
Diffstat (limited to 'math.cginc')
| -rw-r--r-- | math.cginc | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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);
|
