digitalmars.D - Fast Noise - A Noise Library For D
- jordan4ibanez (44/44) Aug 19 2022 I noticed that D was missing a flexible functional multi use
- Guillaume Piolat (3/6) Aug 22 2022 Pretty cool!
- Johan (8/12) Aug 24 2022 I see that [Auburn's Fast Noise Lite
- jordan4ibanez (4/18) Aug 25 2022 That is a good idea. Also about the link, if you looked at the
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: ```d 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.
Aug 19 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.
Aug 22 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](https://github.com/Auburn/FastNoiseLite) 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
Aug 24 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: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 :PI 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](https://github.com/Auburn/FastNoiseLite) 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
Aug 25 2022