dilevin / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
2 stars 5 forks source link

Max value of dot product in perlin noise #25

Open msnhao opened 4 years ago

msnhao commented 4 years ago

The wikipedia article: https://en.wikipedia.org/wiki/Perlin_noise appears to suggest that the dot product between (point - closest_corner) and the random unit vector at the closest corner can be in [-1, 1]. image

However, the implementation they give doesn't normalize the direction(from point to corner), meaning that the maximum absolute value of the dot product should be norm(0.5, 0.5) for 2D and norm(0.5, 0.5, 0.5) for 3D.

In our implementation, should we normalize the direction from point to corner, or should we divide by norm(0.5, 0.5, 0.5) to get a range of [-1, 1]?

PS. For improved perlin noise, do you want us to also implement the pool of 16 random vectors used in the paper or just stick with the random unit sphere? image

Thanks

abhimadan commented 4 years ago

Sorry about the delayed response - you compute the dot products with vectors formed by all corners of the box, so the range of values of the dot product is indeed [-1, 1]. Also notice that in this diagram, the extreme points are a dark green and dark purple, and neither show up, so as you noted, this figure only contains values in [-0.5, 0.5].

For improved Perlin noise, you just change your interpolation polynomial - no need to implement the other stuff mentioned in the paper.