So my understanding of perlin noise is you need to a noise function that works in 2 dimensions then you use a method like the ones below to get smooth noise.
float random(float2 st) {
return frac(sin(dot(st,float2(12.9898, 78.233))) * 43758.5453123);
}
float noise2D(float2 p)
{
float2 i = floor(p);
float2 f = frac(p);
// Four corners in 2D of a tile
float a = random(i);
float b = random(i + float2(1.0, 0.0));
float c = random(i + float2(0.0, 1.0));
float d = random(i + float2(1.0, 1.0));
float2 u = f * f * (3.0 - 2.0 * f);
return lerp(a, b, u.x) +
(c - a) * u.y * (1.0 - u.x) +
(d - b) * u.x * u.y;
}
Issue as I see it is the Perlin Noise space is fairly small. Maybe +/- 43758.5453123. I've tried making the domain value larger but it appears I don't have enough resolution inside a 32-bit float.
Any idea how I can get a much larger noise space on GPU? I know some game worlds claim billions of unique values so I'm just curious if it is possible to get a much larger unique noise space with 32-bit floats.