From 33209b34e2d6b9af2fbc3cd0886a3eb76479a9d2 Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 2 Nov 2024 18:10:15 -0700 Subject: 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. --- math.cginc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'math.cginc') 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; -- cgit v1.2.3