fix: perlin
This commit is contained in:
@@ -180,13 +180,19 @@ float noise_f(vec2 n, int f)
|
||||
|
||||
vec2 perlin_gradient(vec2 p, int seed)
|
||||
{
|
||||
return normalize(
|
||||
vec2 v = normalize(
|
||||
|
||||
vec2(
|
||||
rand(p.x * 12.34 + p.y * 56.78 + seed) * 2.0 - 1.0,
|
||||
rand(p.x * 56.78 + p.y * 12.34 + seed) * 2.0 - 1.0
|
||||
)
|
||||
);
|
||||
|
||||
if (length(v) == 0.) {
|
||||
return vec2(1, 0);
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
float perlin(vec2 p, int seed)
|
||||
|
||||
Reference in New Issue
Block a user