summaryrefslogtreecommitdiffstats
path: root/math.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2025-02-23 16:32:47 -0800
committeryum <yum.food.vr@gmail.com>2025-02-23 16:32:47 -0800
commit63e32a6fc92baecea75942d9389c9fb17540277d (patch)
tree258d1897e7633c358b1121c9e84e9af1f7437174 /math.cginc
parentf478606867d42e971c5fa83803f3255e922e6a8a (diff)
Add UV domain warping
Diffstat (limited to 'math.cginc')
-rw-r--r--math.cginc5
1 files changed, 4 insertions, 1 deletions
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;
}