CubicNoise
An interface which each noise generator must implement.
Producing a one-dimensional based noise value.
The x coordinate.
The noise value.
Produces a two-dimensional based noise value.
The x coordinate.
The y coordinate.
The noise value.
An interface which gets used to provide arbitrary parameter names
to the general noise engine class. It is a way to abstract the
concrete (but to the general noise engine class unknown) parameters
for different noise generators.
This class stores all parameters needed to create a noise engine instance.
The engine's seed value. To use a string value as seed, use the GetDeterministicHashCode() method
which gets provided by this library. A different seed value results in a complete different result.
When you generate e.g. a landscape, two different seeds will produce different landscapes.
The desired kind of noise generator.
A dictionary of additional parameters needed by the chosen noise generator.
Extension methods for this library.
This is a deterministic hash function for strings. The official hash methods in .NET Core are no longer
deterministic due to possible hashing attacks, cf. https://youtu.be/R2Cq3CLI6H8.
The source for this implementation: https://andrewlock.net/why-is-string-gethashcode-different-each-time-i-run-my-program-in-net-core/.
Thanks Andrew for providing such a hash function.
Aware: Never use this hash function for any security-related task or for any hashtable storage, etc.
Please use it only in the case, that you really need a deterministic value. In the context of this
library, the hash values are usually used for media, games, art, or simulations in order to share
results with others. This is the only valid use case!
The string for which a hash value is to be computed.
A deterministic 32 bit / 4 byte hash value of the given string.
The main class of the library. You should use it to generate a noise engine. This class is thread-safe.
You can use all methods from as many threads, as you want. There a no async methods, because the
performance is very high. Even on a 2019 mid-size business laptop with Intel i5 CPU, each core
is able to produce > 6 million values per second (2 dimensions).
Not only the factory method is thread-safe. Each instance of the class is thread-safe as well.
The factory method to use for generating a noise engine. This method is thread-safe. Call it from as many threads
as you want.
The parameters for the desired noise engine.
The desired noise engine instance.
Yields a one-dimensional based noise value. This method is thread-safe as well. Call it from as
many threads as you want. You can expect about 16 million calls per CPU core per second (year 2019).
The x coordinate.
The corresponding noise value for the given coordinate.
Yields a two-dimensional based noise value. This method is thread-safe as well. Call it from as
many threads as you want. You can expect about 6 million calls per CPU core per second (year 2019).
The x coordinate.
The y coordinate.
The corresponding noise value for the given 2d coordinate.
This is the cubic noise engine by Job Talle, cf. https://jobtalle.com/cubic_noise.html. It based on the
C# version which was provided at Github: https://github.com/jobtalle/CubicNoise/blob/master/c%23/CubicNoise.cs.
Thanks Job for your implementation.
Compared to Job's version, this implementation is a bit optimized and
used useful C# 8.0 / .NET Core 3.1 LTS features.
This class contains all known cubic noise's parameters.
Cubic noise's octave parameter.
Cubic noise's period x parameter.
Cubic noise's period y parameter.
This is the random number engine which gets used in case that the UNKNOWN type was used.
This engine is not meant for production. It is a placeholder for empty values, where a type
is needed. The engine will generate a random value each time.
All implemented noise generators.
The UNKNOWN generator is a placeholder for empty values. You should not use it in production. It generates random numbers on every call.
This is the cubic noise generator by Job Talle, cf. https://jobtalle.com/cubic_noise.html and https://github.com/jobtalle.