FigBug / Gin

A few extras for juce
BSD 3-Clause "New" or "Revised" License
262 stars 40 forks source link

How to use gin::PerlinNoise correctly? #34

Closed matkatmusic closed 1 year ago

matkatmusic commented 1 year ago

Hey Roland.

Thanks for fixing that I assert I posted.

I'm using your Perlin Noise class from Gin. It's saving us a lot of time, so thanks for making it.

I'm feeding it a 2D array of x/y coordinates ranging from 0 to 1, with the class declared as gin::PerlinNoise<float>.

I'm expecting to see something like this: expected noise

I'm getting this instead when I use an input range of [0, 1]

Screen Shot 2022-12-29 at 12 43 44 PM

If I use a higher range, some weird tiling happens:

Screen Shot 2022-12-29 at 12 40 17 PM

Is this due to how many octaves you're calculating?

FigBug commented 1 year ago

Well that's embarrassing. Both perlin noise constructors were broken. Now it looks like this:

image