Supprocom.OpenSimplexNoise
0.1.2
dotnet add package Supprocom.OpenSimplexNoise --version 0.1.2
NuGet\Install-Package Supprocom.OpenSimplexNoise -Version 0.1.2
<PackageReference Include="Supprocom.OpenSimplexNoise" Version="0.1.2" />
<PackageVersion Include="Supprocom.OpenSimplexNoise" Version="0.1.2" />
<PackageReference Include="Supprocom.OpenSimplexNoise" />
paket add Supprocom.OpenSimplexNoise --version 0.1.2
#r "nuget: Supprocom.OpenSimplexNoise, 0.1.2"
#:package Supprocom.OpenSimplexNoise@0.1.2
#addin nuget:?package=Supprocom.OpenSimplexNoise&version=0.1.2
#tool nuget:?package=Supprocom.OpenSimplexNoise&version=0.1.2
Upstream acknowledgment: KdotJPG created OpenSimplex Noise. digitalshadow produced the refactored C# port used by VoxelEngine and this package. The port remains available under its original Unlicense and public-domain dedication.
Supprocom.OpenSimplexNoise
Supprocom.OpenSimplexNoise supplies deterministic OpenSimplex Noise for C#.
The public OpenSimplexNoise type evaluates two-dimensional, three-dimensional,
and four-dimensional coordinates.
The parameterless constructor uses the current clock value as its seed. The
OpenSimplexNoise(long seed) constructor gives the same output for the same seed.
These compatibility constructors allocate managed arrays.
Installation
Use this command to install version 0.1.2.
dotnet add package Supprocom.OpenSimplexNoise --version 0.1.2
Example
using Supprocom.OpenSimplexNoise;
var noise = new OpenSimplexNoise(123456);
var height = noise.Evaluate(12.5, -4.25);
var density = noise.Evaluate(12.5, -4.25, 8.0);
var sample = noise.Evaluate(12.5, -4.25, 8.0, 0.5);
Allocation-free state
Use the static API when the sampling boundary cannot allocate managed memory. The caller owns four permutation tables and one source scratch buffer. Each buffer must contain at least 256 bytes, and the buffers must not overlap.
using Supprocom.OpenSimplexNoise;
Span<byte> permutation = stackalloc byte[OpenSimplexNoise.PermutationTableLength];
Span<byte> permutation2D = stackalloc byte[OpenSimplexNoise.PermutationTableLength];
Span<byte> permutation3D = stackalloc byte[OpenSimplexNoise.PermutationTableLength];
Span<byte> permutation4D = stackalloc byte[OpenSimplexNoise.PermutationTableLength];
Span<byte> sourceScratch = stackalloc byte[OpenSimplexNoise.SourceScratchLength];
OpenSimplexNoise.Initialize(
123456,
permutation,
permutation2D,
permutation3D,
permutation4D,
sourceScratch);
var height = OpenSimplexNoise.Evaluate(permutation, permutation2D, 12.5, -4.25);
var density = OpenSimplexNoise.Evaluate(permutation, permutation3D, 12.5, -4.25, 8.0);
var sample = OpenSimplexNoise.Evaluate(permutation, permutation4D, 12.5, -4.25, 8.0, 0.5);
Initialization writes all five buffers. The source scratch buffer is not required during evaluation. Successful initialization and evaluation do not allocate managed memory.
Package tests compare exact output bits with the published version 0.1.0 output. The tests include zero, negative, large, epsilon, and finite double-limit inputs. They also measure managed allocations for initialization and evaluation.
Development
Build and test the solution in Release mode with the .NET 10 SDK:
dotnet test Supprocom.OpenSimplexNoise.slnx --configuration Release
The build runs the complete SDK analyzer rule set and pinned Meziantou, Roslynator, threading, banned API, public API, and xUnit analyzers. Enabled diagnostics, including code style suggestions, are treated as build errors. The tracked public API files preserve the released constructors, constants, and evaluation overloads. Analyzer dependencies are private to the build.
Source
The public repository contains the preferred source form, tests, build files, and package documents. This source remains available while the binary package remains available.
License
The digitalshadow source remains available under its original Unlicense and public-domain dedication. Supprocom does not change that upstream license.
Supprocom publishes only its combined work and modifications under AGPL-3.0-only. See LICENSE, NOTICE, and THIRD-PARTY-NOTICES.md for the complete terms and notices.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Enforces the complete analyzer gate, documents and tracks the existing public API, and identifies overlapping initialization buffers. Preserves exact noise outputs and allocation-free caller-owned state.