fBm
Adds octaves at increasing frequency and decreasing amplitude. Configure octave count, lacunarity, gain, and weighted strength.
.NET 10 · CPU and Vulkan · 2D and 3D
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.
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
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 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 octaves. General terrain and 3D density.
Lower kernel cost; mild axial structure.
No gradient-table lookup. Suitable before thresholding or quantization.
Cell boundaries, cracks, regions, and cave partitions.
Absolute-value folding converts octave minima into sharp ridges.
Continents, ridges, and surface variation evaluated in one fill.
Implemented algorithms
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.
| Kernel | Construction | Bulk path | Operational characteristics |
|---|---|---|---|
OpenSimplex2 | Simplex-lattice gradients | Wide | No preferred Cartesian direction; default for 3D density fields. |
OpenSimplex2S | Expanded simplex kernel | Scalar | Smoother response and more corners. Parallel rows remain available; SIMD is disabled because lanes select different branch chains. |
Perlin | Cubic-lattice gradients | Wide | Lower cost than simplex noise. Axis alignment can appear in 3D fields. |
Value | Cubic-Hermite interpolation | Wide | Lowest-cost kernel. No gradient table; lattice structure is more visible. |
ValueCubic | Cubic interpolation over lattice values | Wide | Smooth low-frequency output. Reads 16 lattice values in 2D and 64 in 3D. |
Cellular | Nearest feature points | Wide | Euclidean, squared Euclidean, Manhattan, or hybrid distance; seven return modes from cell value to distance ratios. |
Adds octaves at increasing frequency and decreasing amplitude. Configure octave count, lacunarity, gain, and weighted strength.
Folds each octave around zero and inverts it. The former minima become narrow, high-valued ridges.
Repeatedly folds the octave signal through a bounded interval. Produces bands, terraces, and repeated strata.
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
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.
| Kernel | Point loop | Scalar fill | SIMD fill | Parallel 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
The CPU implementation reduces dispatch, temporary memory, and cache-line contention. Fused multiply-add is intentionally excluded to preserve exact agreement across CPU backends.
Auto selects scalar, SIMD, or parallel SIMD from sample count, hardware vector support, and kernel capability. Configuration is snapshotted before row execution.
Rows are contiguous ranges in the destination. Parallel workers receive disjoint row groups; a cache line can still be shared at a range boundary.
A ramp generates originX + n × step for all lanes. Y and Z remain broadcast values. No matrix transpose is required.
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.
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.
ScalarPortable lane width of one. Used explicitly, on non-vector hardware, and for OpenSimplex2S.
SimdSingle-threaded Vector<float>. Suitable when the buffer is large enough to amortize setup but caller-level scheduling already owns parallelism.
ParallelRow ranges execute through Parallel.For. Default threshold is 16,384 samples to avoid thread-pool overhead on small fills.
GpuThe 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
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
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.



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.SampleComplete runnable sample · GPU API and buffer layout · 2D Vulkan field sample
Algorithm graphs
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.



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
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
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.




wavelengthi = 1 / (frequency × lacunarityi)
Keep octave i only while its wavelength satisfies the configured samples-per-wavelength limit.
Configuration tool
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.
Package
Targets .NET 10. The package contains the managed library, XML documentation, and deterministic symbols.
dotnet add package Tedd.FastNoiseOptional GPU package
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.GpuBulk 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.