.NET 10 · CPU and Vulkan · 2D and 3D

Fill terrain tiles.
Fill voxel volumes.

Compose noise, relief and material rules into optimized algorithm graphs. Execute on the CPU or generate specialized Vulkan kernels that write terrain directly into GPU buffers.

  • OpenSimplex2, Perlin, Value, and Cellular kernels
  • fBm, ridged, and ping-pong fractals
  • Mathematical folding and sample-aware level of detail
  • GPU-resident noise fields and compact voxel bricks
OpenSimplex2 · 48³ field · threshold 0.08
Isometric rendering of a thresholded 48 by 48 by 48 OpenSimplex2 noise volume
Actual 3D output. Generated by one GridRegion3D fill, then thresholded and projected as exposed voxels.

6 kernelsOpenSimplex2/S, Perlin, Value/Cubic, Cellular

2D + 3DSingle samples, grids, and volumes

X-fastestContiguous output and vector lanes

Exact equalityScalar, SIMD, parallel, x86, and ARM

Primary contract

A region in.
A flat buffer out.

NoiseGenerator stores the signal configuration. GridRegion2D and GridRegion3D specify the first sample, sample count, and world-space step. Fill writes values in X-major order without allocating.

var densityNoise = new NoiseGenerator(seed: 1337)
{
    NoiseType  = NoiseType.OpenSimplex2,
    FractalType = FractalType.FBm,
    Octaves    = 5,
    Frequency  = 0.005f,
};

var region = GridRegion3D.Chunk(
    chunkX, 0, chunkZ, chunkSize: 16);

var density = new float[region.SampleCount];
densityNoise.Fill(density, region); // Auto backend

// x + width * (y + height * z)
float voxel = density[x + 16 * (y + 16 * z)];

Generated fields

The kernels have different spectra and artifacts.

The gallery sample fills each field with Tedd.FastNoise and writes the PNG files. Run it locally to reproduce these images. Equal seeds reproduce equal samples.

Five octave OpenSimplex2 fractional Brownian motion field
01 / isotropic gradientOpenSimplex2 + fBm

Five octaves. General terrain and 3D density.

Five octave Perlin fractional Brownian motion field
02 / cubic lattice gradientPerlin + fBm

Lower kernel cost; mild axial structure.

Four octave Value noise field
03 / lattice valuesValue + fBm

No gradient-table lookup. Suitable before thresholding or quantization.

Cellular noise using second-nearest minus nearest distance
04 / feature pointsCellular Distance2Sub

Cell boundaries, cracks, regions, and cave partitions.

Six octave ridged OpenSimplex2 field
05 / transformed octavesRidged OpenSimplex2

Absolute-value folding converts octave minima into sharp ridges.

Terrain field composed from continent, mountain, and surface layers
06 / compiled stackLayered terrain

Continents, ridges, and surface variation evaluated in one fill.

Implemented algorithms

Kernel selection is an engineering trade-off.

All kernels support 2D and 3D sampling. “Wide” below means the bulk path is instantiated over System.Numerics.Vector<T>. Actual lane width is selected by the runtime and CPU.

KernelConstructionBulk pathOperational characteristics
OpenSimplex2Simplex-lattice gradientsWideNo preferred Cartesian direction; default for 3D density fields.
OpenSimplex2SExpanded simplex kernelScalarSmoother response and more corners. Parallel rows remain available; SIMD is disabled because lanes select different branch chains.
PerlinCubic-lattice gradientsWideLower cost than simplex noise. Axis alignment can appear in 3D fields.
ValueCubic-Hermite interpolationWideLowest-cost kernel. No gradient table; lattice structure is more visible.
ValueCubicCubic interpolation over lattice valuesWideSmooth low-frequency output. Reads 16 lattice values in 2D and 64 in 3D.
CellularNearest feature pointsWideEuclidean, squared Euclidean, Manhattan, or hybrid distance; seven return modes from cell value to distance ratios.
Fractal accumulation

fBm

Adds octaves at increasing frequency and decreasing amplitude. Configure octave count, lacunarity, gain, and weighted strength.

Fractal accumulation

Ridged

Folds each octave around zero and inverts it. The former minima become narrow, high-valued ridges.

Fractal accumulation

Ping-pong

Repeatedly folds the octave signal through a bounded interval. Produces bands, terraces, and repeated strata.

Coordinate transform

Domain warp

OpenSimplex2, reduced simplex, or basic-grid warps; progressive and independent octave modes. The current warp API operates on individual 2D or 3D coordinates.

Measured CPU performance

Choose the kernel.
Choose the access path.

Each result fills or samples the same 65,536 coordinates. Compare all six kernels as single-octave signals or four-octave fBm, in a 2D tile or 3D volume. Shorter bars mean less elapsed time.

Point loop = repeated GetNoise. All other paths use Fill on a preallocated destination.

Benchmark graphs require JavaScript.

KernelPoint loopScalar fillSIMD fillParallel fill
Benchmark values require JavaScript.

Bars show median milliseconds per field; fine marks span the 10th–90th percentile across 13 timed calls. Each kernel card has its own scale, so use the numeric values to compare different kernels. OpenSimplex2S has no SIMD kernel and its SIMD request uses the scalar path. Parallel timing includes scheduling overhead and depends strongly on available cores. Measured at High process priority with background CPU activity. Full data and machine details · Raw observations and reproduction.

Bulk execution

Where the throughput comes from.

The CPU implementation reduces dispatch, temporary memory, and cache-line contention. Fused multiply-add is intentionally excluded to preserve exact agreement across CPU backends.

  1. 01

    Resolve one fill plan

    Auto selects scalar, SIMD, or parallel SIMD from sample count, hardware vector support, and kernel capability. Configuration is snapshotted before row execution.

  2. 02

    Partition complete rows

    Rows are contiguous ranges in the destination. Parallel workers receive disjoint row groups; a cache line can still be shared at a range boundary.

  3. 03

    Construct X-coordinate vectors

    A ramp generates originX + n × step for all lanes. Y and Z remain broadcast values. No matrix transpose is required.

  4. 04

    Execute one generic kernel body

    The scalar and vector implementations instantiate the same generic arithmetic over different operation sets. The scalar path has one lane; the vector path uses the hardware width.

  5. 05

    Store contiguous vectors

    Full vectors are written directly into the caller’s span. A scalar tail handles row widths that are not multiples of the current lane count.

Scalar

Portable lane width of one. Used explicitly, on non-vector hardware, and for OpenSimplex2S.

Simd

Single-threaded Vector<float>. Suitable when the buffer is large enough to amortize setup but caller-level scheduling already owns parallelism.

Parallel

Row ranges execute through Parallel.For. Default threshold is 16,384 samples to avoid thread-pool overhead on small fills.

Gpu

The host-buffer enum routes through a registered INoiseAccelerator, falling back to CPU when unavailable. GPU-resident generation uses the separate VulkanNoiseProducer command-buffer API below.

Determinism

Equal floats, not approximately equal floats.

Backend agreement tests compare complete output buffers with exact equality. Scalar and SIMD share kernel source; operation order is fixed; fused multiply-add is not used. This prevents a threshold such as density > 0 from selecting different voxels on clients with different CPUs.

Vulkan compute

Generate terrain where it is rendered.

Tedd.FastNoise.Gpu writes into caller-owned storage buffers. RecordNoise produces float32 fields; RecordTerrain evaluates density, classifies cells and packs voxel bricks without requiring CPU readback.

LOD-resolved requestsCreateRequest snapshots settings and filters octaves for the world-space sample spacing.

Compact 4³ bricksEmpty bricks have no cell payload. Uniform bricks store one cell; mixed bricks store 64.

Renderer-owned resourcesReuse your Vulkan device, command buffers and allocations. The producer records work and memory barriers.

// Use the renderer's Vulkan device and an allocated output buffer.
using var producer = new VulkanNoiseProducer(vk, physicalDevice, device);
using var output = producer.BindOutput(buffer, VoxelTerrainSettings.RequiredBytes(32));
var noise = new NoiseGenerator(1337)
{
    NoiseType = NoiseType.OpenSimplex2, FractalType = FractalType.FBm,
    Frequency = 0.01f, Octaves = 6, Lod = LodPolicy.Automatic,
};
var request = noise.CreateRequest(new GridRegion3D(-128, -128, -128, 32, 32, 32, Step: 8));
producer.RecordTerrain(commandBuffer, output, request,
    new VoxelTerrainSettings(Height: 0, Amplitude: 180));
// Submit, render, and keep resources alive until GPU work completes.
Vulkan-generated terrain sampled at 32 cubed voxels, eight world units per cell
32³ cells · step 8Three surviving noise octaves.
The same world region sampled at 16 cubed voxels, sixteen world units per cell
16³ cells · step 16Two surviving noise octaves.
The same world region sampled at eight cubed voxels, thirty-two world units per cell
8³ cells · step 32One surviving noise octave.

The examples cover the same 256-world-unit cube. The runnable sample executes Vulkan compute, reads back the packed cells and projects them into these images. These previews were generated locally on an NVIDIA GeForce RTX 4090; rendering engines can consume the same format directly on the GPU.

OpenSimplex2, Perlin and Value support None, fBm, Ridged and PingPong fractals. Compose these generators and import resolved stacks through ProceduralGraph. GPU output is tested against CPU values, but cross-device bit equivalence is not guaranteed. Domain warp remains a CPU operation.

The voxel layout matches Forcecraft10's production brick directory. VulkanNoiseProducer supplies one opaque material; VulkanGraphTerrainProducer selects host-defined palette materials through column and voxel graphs. Lighting propagation, pristine-chunk selection and edit invalidation remain host responsibilities.

dotnet run -c Release --project samples/Tedd.FastNoise.Gpu.Sample

Complete runnable sample · GPU API and buffer layout · 2D Vulkan field sample

Algorithm graphs

Your planetary recipe.
Shared optimized kernels.

ProceduralGraph composes typed arithmetic, noise, comparisons, selection and table lookups. Supply the seed, layers, climate and material rules; FastNoise owns folding, specialization and CPU/GPU compilation. No game-engine dependency is required.

// All values below are typed edges from the same graph.
var resolvedDetail = graph.Select(
    graph.Constant(step <= detailCutoff), detail, graph.Constant(0d));
var elevation = continents * graph.Constant(relief) + resolvedDetail;
var columns = graph.Compile(elevation, moisture);
// CPU: columns.Evaluate / Fill.
// GPU: use columns and a material graph with VulkanGraphTerrainProducer.

Less arithmeticFold constants, share repeated expressions and eliminate unused outputs or constant branches. Floating-point operations retain their order; algebraic reassociation is not assumed.

Specialize onceGenerated CPU delegates and optimized GLSL/SPIR-V specialize an immutable recipe and LOD. Reuse them to amortize compilation. GPU graphs require shaderFloat64.

Keep data residentA column kernel shares relief and climate across vertical cells; a material kernel classifies and packs bricks. Intermediate fields remain on the GPU.

Top-down material map of composed planetary terrain at 32 cubed cells
32³ cells · step 8Continents, mountains, moisture and detail.
The same planetary material region at 16 cubed cells
16³ cells · step 16Identical recipe, LOD-resolved noise.
Coarse planetary material map at eight cubed cells
8³ cells · step 32Detail branch eliminated before execution.

The runnable planet recipe composes continental fBm, ridged mountains, optional detail, moisture, soil, snow and sea level. These are illustrative Earth-like rules, not a fixed Earth preset or a complete game world. Applications supply their own parameters and layering.

The sample produces these material maps through Vulkan, checks every cell against the same CPU graphs, and writes inspectable GLSL. Water is an opaque material in this demonstration. Fewer operations or transfers do not by themselves guarantee better end-to-end performance.

Composition

Compile layers into one executor.

NoiseStack.Compile() copies generator settings into a flat immutable plan. During a fill, each active layer consumes the current coordinate vector and blends into a register-resident accumulator.

var stack = new NoiseStack
{
    Lod = LodPolicy.Automatic with { CullLayers = true },
};

stack.Add(new NoiseLayer
{
    Source = new NoiseGenerator(1) { Frequency = 0.0002f, FractalType = FractalType.FBm, Octaves = 4 },
    FeatureSize = 2000f,
    Name = "continents",
});

stack.Add(new NoiseLayer
{
    Source = new NoiseGenerator(2) { Frequency = 0.002f, FractalType = FractalType.Ridged, Octaves = 5 },
    Blend = LayerBlend.Add,
    Amplitude = 0.4f,
    FeatureSize = 200f,
    Name = "mountains",
});

var world = stack.Compile(); // immutable and thread-safe
world.Fill(heights,  new GridRegion2D(0, 0, 512, 512, Step: 1f));
world.Fill(overview, new GridRegion2D(0, 0, 512, 512, Step: 512f));

Blend operatorsAdd, Subtract, Multiply, Min, Max, Replace, and Lerp.

Memory trafficOne output write per sample; the stack does not allocate one field buffer per layer.

Thread modelThe compiled stack is immutable and can be shared by chunk-generation workers.

Level of detail

Do not evaluate frequencies the sample grid cannot represent.

LodPolicy uses sample spacing, base frequency, lacunarity, and a configurable Nyquist factor to select octave count. It can also reject complete layers by declared feature size.

Eight octave terrain at one world unit per sample
Step 1All configured octaves are representable.
The same terrain at 64 world units per sample with fine octaves removed
Step 64Fine octaves and the surface layer are removed.
Terrain at 128 world units per sample retaining only coarse continental detail
Step 128Only coarse continental detail remains.
Aliased full-detail terrain sampled at 4096 world units per sample
Step 4096, LOD disabledFine signal aliases into unrelated sample values.
wavelengthi = 1 / (frequency × lacunarityi) Keep octave i only while its wavelength satisfies the configured samples-per-wavelength limit.

Configuration tool

Inspect the field before integrating it.

The Windows designer edits every generator and stack parameter, renders a 2D field, a lit heightmap, or a thresholded 3D volume, and emits the corresponding C# configuration.

  • Fixed world-space centre while sample spacing changes
  • Live fill time and sample throughput
  • Active-layer and active-octave inspection
  • Self-contained Windows x64 release
Download designer
Tedd.FastNoise.Designer
Tedd.FastNoise designer showing a terrain preview, layer controls, and generated C sharp

Package

Install Tedd.FastNoise.

Targets .NET 10. The package contains the managed library, XML documentation, and deterministic symbols.

dotnet add package Tedd.FastNoise

Optional GPU package

Install Tedd.FastNoise.Gpu.

Vulkan compute for .NET 10, including the CPU library and Silk.NET bindings. Requires a Vulkan compute device and driver.

dotnet add package Tedd.FastNoise.Gpu

Current scope

Bulk noise fills, compiled layer stacks, typed procedural graphs with mathematical folding, SIMD CPU execution and per-point domain warp are available. The Vulkan package generates fields and multi-material bricks from specialized graphs using OpenSimplex2, Perlin and Value. Graphs require shaderFloat64; Float64 power, other GPU noise algorithms and bulk domain-warp fill are unsupported.