summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-10-08 17:32:09 -0700
committeryum <yum.food.vr@gmail.com>2024-10-08 17:32:09 -0700
commita396182815db14f5a6eed26799dd425506a70686 (patch)
tree38f1d2ca8cb3cd6bd8b87fdcb2678ac2e911e90b /math.cginc
parentbcadf1d091efe76e7a1b2393f87f7e24128b723b (diff)
Add fog parameters; add Unity fog to fwd/add passes
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc7
1 files changed, 7 insertions, 0 deletions
diff --git a/math.cginc b/math.cginc
index 46e19e1..968f888 100644
--- a/math.cginc
+++ b/math.cginc
@@ -3,6 +3,13 @@
#ifndef __MATH_INC
#define __MATH_INC
+// Hacky parameterizable whiteout blending. Probably some big mistakes but it
+// passes the eyeball test.
+// At w=0.5, this looks kinda like whiteout blending.
+// At w=0, this returns n0.
+// At w=1, this returns n1.
+#define MY_BLEND_NORMALS(n0, n1, w) normalize(float3((n0.xy * (1 - w) + n1.xy * w), lerp(1, n0.z, (1-w)) * lerp(1, n1.z, w)))
+
// Complex numbers
typedef float2 complex;