From 63e32a6fc92baecea75942d9389c9fb17540277d Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 23 Feb 2025 16:32:47 -0800 Subject: Add UV domain warping --- math.cginc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'math.cginc') diff --git a/math.cginc b/math.cginc index 8edbc88..f3af30a 100644 --- a/math.cginc +++ b/math.cginc @@ -5,6 +5,7 @@ #define PI 3.14159265358979323846264 #define TAU (2 * PI) +#define PHI 1.618033989 float pow5(float x) { @@ -65,12 +66,14 @@ float2 domainWarp1(float x, uint octaves, float strength, float scale) float2 domainWarp2(float2 uv, uint octaves, float strength, float scale) { + uv *= 0.001; [loop] for (uint i = 0; i < octaves; i++) { uv += strength * frac(sin(float2( dot(uv * scale, float2(12.9898, 78.233)), - dot(uv * scale + 1, float2(12.9898, 78.233))) * 43758.5453123)); + dot(uv * scale, float2(36.7539, 50.3658))) * 43758.5453123)); } + uv *= 1000; return uv; } -- cgit v1.2.3