added support for 2d perlin noise

This commit is contained in:
2025-02-05 14:46:32 -05:00
parent 03ff7553ea
commit e8f4588a09

View File

@@ -25,20 +25,22 @@ namespace ReNoise {
/// \brief Generates a 1D Perlin noise array.
///
/// The noise is computed by interpolating between pseudorandom gradients at lattice points.
/// The noise is computed by interpolating between pseudo-random gradients at lattice points.
/// \param noiseResolution The number of noise samples to generate.
/// \param rng A reference to an initialised ReUnirand random number generator.
/// \return A vector of floats representing the 1D Perlin noise.
std::vector<float> generatePerlinNoise1D(int noiseResolution, ReUnirand::MarsagliaUniRng &rng);
std::vector<float> generatePerlinNoise2D(int noiseWidth, int noiseHeight, ReUnirand::MarsagliaUniRng &rng);
/// \brief Smooths a noise array using a parabolic kernel.
///
/// This function convolves the input noise array with a kernel whose weights follow a
/// parabolic (hyperbolic parabolalike) curve.
/// parabolic (hyperbolic parabola-like) curve.
/// \param noise A vector containing the original noise values.
/// \param kernelRadius The radius (number of neighbours on each side) to include in the smoothing.
/// \return A vector of floats representing the smoothed noise.
std::vector<float> smoothNoise(const std::vector<float> &noise, int kernelRadius);
std::vector<float> smoothNoise1D(const std::vector<float> &noise, int kernelRadius);
std::vector<float> smoothNoise2D(const std::vector<float>& noise, int noiseWidth, int noiseHeight, int kernelRadius);
} // namespace ReNoise