Home

Awesome

siv::PerlinNoise

noise

siv::PerlinNoise is a header-only Perlin noise library for modern C++ (C++17/20).
The implementation is based on Ken Perlin's Improved Noise.

Features

License

siv::PerlinNoise is distributed under the MIT license.

Usage

# include <iostream>
# include "PerlinNoise.hpp"

int main()
{
	const siv::PerlinNoise::seed_type seed = 123456u;

	const siv::PerlinNoise perlin{ seed };
	
	for (int y = 0; y < 5; ++y)
	{
		for (int x = 0; x < 5; ++x)
		{
			const double noise = perlin.octave2D_01((x * 0.01), (y * 0.01), 4);
			
			std::cout << noise << '\t';
		}

		std::cout << '\n';
	}
}

API

template <class Float> class BasicPerlinNoise

Example

Run example.cpp with the following parameters.

frequency = 8.0
octaves = 8
seed = 12345

noise


frequency = 8.0
octaves = 8
seed = 23456

noise


frequency = 8.0
octaves = 3
seed = 23456

noise