summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-11-02 18:10:15 -0700
committeryum <yum.food.vr@gmail.com>2024-11-02 18:15:00 -0700
commit33209b34e2d6b9af2fbc3cd0886a3eb76479a9d2 (patch)
tree4b71ad4676e16fa412b706b8563f8e8740e4d246 /math.cginc
parent76af070567daeb845cabbf9a414cf487b88c12f9 (diff)
Fog uses interleaved gradient noise instead of white noise
This lets us use a much higher step size before noise becomes too gross to look at.
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 8aaa5ea..d7656e1 100644
--- a/math.cginc
+++ b/math.cginc
@@ -13,6 +13,11 @@
// 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)))
+float golden_lds(uint i)
+{
+ return glsl_mod(1.61803398875 * float(i), 1);
+}
+
// Complex numbers
typedef float2 complex;