I'm implementing a 3D perlin noise-based spherical planet generator but I'm getting line artifacts when trying to leverage the analytical derivative in the noise calculations. I'm calculating the analytical derivative using Milo Yip's approach: 3D Perlin noise analytical derivative
For instance, when trying to use IQ noise:
float IQturbulence(float3 p, int octaves, float freq, float amp, float gain, float lacunarity)
{
float sum = 0.5;
float3 dsum = float3(0,0,0);
for(int i = 0; i < octaves; i++)
{
float4 n = noiseDeriv((p*freq), (i)/256.0);
dsum += n.yzw;
sum += amp * n.x / (1 + dot(dsum,dsum));
freq *= lacunarity;
amp *= gain;
}
return sum;
}
I get these grid line artifacts that look like this:
https://i.stack.imgur.com/pyynF.jpg
However, these lines only occur when I leverage the dot product (scalar) of the derivative in the noise calculation,
i.e.
(1 + dot(deriv,deriv))
whether that is used to modulate the amplification, frequency, etc. it always seems to produce artifacts.
When using the derivative to domain warp, I get no line artifacts.
ex.
float4 n = noiseDeriv((p + 0.15 * dsum) * freq, (i)/256.0);
Is this simply a limitation with classic Perlin noise? I'm a bit hesitant to change noise algorithms entirely at this stage of my project. :/
- Note: I am using quintic functions when calculating the derivative.