Closed PottierLoic closed 6 months ago
The noise
module has been expanded with new capabilities for generating Perlin noise, a popular gradient noise function. It now includes methods for both 2D and 3D noise generation. The update introduces a Perlin
struct for 2D noise with methods to randomize and generate noise values, and a new function to calculate 3D Perlin noise.
File(s) | Change Summary |
---|---|
noise/perlin2d.v |
Added Perlin struct with methods for 2D noise. |
noise/perlin3d.v |
Introduced function for 3D Perlin noise. |
🐰 "In the realm of code, so spry and bold,
A rabbit hopped through the fields of old.
With Perlin whispers in 2D and 3D, quite fair,
It crafted worlds with a random, soft flair." 🌌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Just realized that I didn't make it random, actually the permutation set never change... We can't just shuffle for every value because it wouldn't make perlin noise anymore so maybe creating a generator struct that hold the permutations is possible ? This way we can have a perlin.randomize() and a perlin.3d(x, y, z) etc.
Also run v fmt
on the files
completely forgot sorry
@ulises-jeremias I'm unsure what the linter errors are about 🤔
I think it's good like this, I can add some examples later if needed.
Fixed 2d perlin noise and added 3d function too !
using this code, the 2d perlin noise look like this:
and using this code and by increasing depth we have this 3d perlin noise:
Summary by CodeRabbit