Thread overview
Fast Noise - A Noise Library For D
Aug 20, 2022
jordan4ibanez
Aug 22, 2022
Guillaume Piolat
Aug 24, 2022
Johan
Aug 26, 2022
jordan4ibanez
August 20, 2022

I noticed that D was missing a flexible functional multi use noise library for game development. I fixed this by translating Auburn's Fast Noise - Lite into D as it's a header only implementation of multiple noise algorithms. These include:

  • 2D & 3D
  • OpenSimplex2 Noise
  • OpenSimplex2S Noise
  • Cellular (Voronoi) Noise
  • Perlin Noise
  • Value Noise
  • Value Cubic Noise
  • OpenSimplex2-based Domain Warp
  • Basic Grid Gradient Domain Warp
  • Multiple fractal options for all of the above
  • Supports floats and/or doubles

The default is double.

You can see/get it here: https://code.dlang.org/packages/fast_noise

Here is an example on how to use it:

import std.stdio;
import std.random;
import fast_noise;

void main() {
    // This is an example on how to use the library
    FNLState noise = fnlCreateState();
    noise.seed = unpredictableSeed();
    noise.noise_type = FNLNoiseType.FNL_NOISE_PERLIN;
    writeln("Begin perlin noise:");
    for (double i = 0; i < 100; i++) {
        double test = fnlGetNoise3D(&noise, 0,i,0);
        writeln("noise: ", test);
    }

    // You can also initialize it with a seed
    FNLState moreNoise = fnlCreateState(unpredictableSeed());
    moreNoise.noise_type = FNLNoiseType.FNL_NOISE_OPENSIMPLEX2;
    writeln("Begin OpenSimplex2 noise:");
    for (double i = 0; i < 100; i++) {
        double test = fnlGetNoise3D(&moreNoise, 0,i,0);
        writeln("noise: ", test);
    }

}```


Hopefully this small library gets you going on your noise generated implementation for your video game. Thanks for reading.
August 22, 2022

On Saturday, 20 August 2022 at 01:03:15 UTC, jordan4ibanez wrote:

>

Hopefully this small library gets you going on your noise generated implementation for your video game. Thanks for reading.

Pretty cool!
This will be super useful.

August 24, 2022

On Saturday, 20 August 2022 at 01:03:15 UTC, jordan4ibanez wrote:

>

I noticed that D was missing a flexible functional multi use noise library for game development. I fixed this by translating Auburn's Fast Noise - Lite into D as it's a header only implementation of multiple noise algorithms.

I see that Auburn's Fast Noise Lite repository contains implementations for several languages. Consider uploading your D port to that repo, to give it more visibility and discoverability (or add a link in the readme of that repo to your repo).

cheers,
Johan

August 26, 2022

On Wednesday, 24 August 2022 at 08:08:21 UTC, Johan wrote:

>

On Saturday, 20 August 2022 at 01:03:15 UTC, jordan4ibanez wrote:

>

I noticed that D was missing a flexible functional multi use noise library for game development. I fixed this by translating Auburn's Fast Noise - Lite into D as it's a header only implementation of multiple noise algorithms.

I see that Auburn's Fast Noise Lite repository contains implementations for several languages. Consider uploading your D port to that repo, to give it more visibility and discoverability (or add a link in the readme of that repo to your repo).

cheers,
Johan

That is a good idea. Also about the link, if you looked at the dub package/github repo I did link to the original file in the repo that this was translated from :P