Remix.run Logo
badpun 2 days ago

I've implemented 3D perlin noise recently and was surprised that the lighting was always off on the created model around the grid lattice (the model itself was continuous there, just the light was not correct). After a delightful couple of days debugging it, I finally learned that Perlin noise's derivative is not continuous around grid lattice, which makes normals not continous there (as normals are orthogonal to a tangent, and tangent is based on derivative). It's possible to improve it by cleverly changing Perlin's wavelet function, which makes the noise C(1) (derivative is continuous, second derivative is not) - this makes the visual artifacts smaller, but they don't go away.

Sharlin 2 days ago | parent [-]

This is addressed in Perlin's improved noise function that uses a 5th degree polynomial ("smootherstep", t³·(10t·(6t-15)) in Horner's form) for interpolation which has everywhere continuous first and second derivatives.

badpun 2 days ago | parent [-]

Yes, that's what I did and what I reffered to in my post (I forgot that it gave you C(2) and not just C(1), it's been a couple of months since I worked on this). There are still visual artifacts, they're just smaller. Even Perlin's paper on this showed a picture of the artifacts that the 5th degree polynomial still generates.