loud is a pure-Dart procedural noise toolkit for generating deterministic 1D/2D/3D noise and composing it into texture or terrain pipelines.
This package gives you building blocks for procedural generation:
- Create seeded noise fields (value, Perlin, simplex, cellular, white, flat).
- Sample noise in 1D, 2D, or 3D (
noise1,noise2,noise3). - Chain modifiers (scale, octave, warp, exponent, output fitting).
- Apply interpolation filters (linear, hermite, cubic, starcast).
- Cache sampled planes with wrapping or mirrored coordinates.
- Use the included Flutter demo app (
loud_texture/) to render procedural materials.
From pubspec.yaml:
- Dart SDK:
>=2.18.4 <3.0.0
dependencies:
loud: ^1.0.3Then:
dart pub getimport 'package:loud/loud.dart';
import 'package:loud/util/double_cache.dart';
void main() {
final warpField = PerlinProvider(seed: 42).scale(0.02);
final terrain = SimplexProvider(seed: 1337)
.octave(5, 0.5)
.scale(0.01)
.warp(warpField, 0.02, 35.0)
.fit(0.0, 1.0);
final cached = terrain.cached(
width: 1024,
height: 1024,
coordinatePlane: CacheCoordinatePlane.mirrored,
lazy: true,
);
print(cached.noise2(128, 256));
}WhiteProvider(seed: ...)- Deterministic hash-based white noise.
FlatProvider(seed: ...)- Constant output (
1.0) field.
- Constant output (
ValueLinearProvider(seed: ...)- Value noise with linear interpolation.
ValueHermiteProvider(seed: ...)- Value noise with hermite smoothing.
PerlinProvider(seed: ...)- Gradient Perlin-style noise.
SimplexProvider(seed: ...)- 3D simplex-style noise (1D/2D calls route through 3D sampling).
CellularProvider(seed: ...)- Worley/cellular nearest-cell value selection.
CellularHeightProvider(seed: ...)- Cellular edge distance style output (
distance2 - distance - 1).
- Cellular edge distance style output (
scale(double scale)- Scales input coordinates.
octave(int octaves, double gain)- Layered/fractal accumulation of the same generator.
warp(NoisePlane warp, double scale, double multiplier)- Domain warping using another noise plane.
fit(double min, double max)- Remaps output range.
exponent(double exponent)- Applies power curve to outputs.
cellularize(int seed)- Samples your current generator via nearest cellular points.
linear(double scale)- Linear interpolation upsampling.
hermite(double scale)- Hermite interpolation upsampling.
cubic(double scale)- Cubic interpolation upsampling.
starcast(double scale, double checks)- Radial sample averaging with configurable sample count.
starcast9(double scale)- Convenience starcast with 9 checks.
cached({width, height, coordinatePlane, lazy, initialValue})- Caches
noise2values in a 2D array. - Supports:
CacheCoordinatePlane.normalCacheCoordinatePlane.mirrored
lazy: falseprecomputes cache.lazy: truecomputes on demand.
- Caches
benchmark(String name, double ms)- Prints approximate sampling throughput for 1D/2D/3D.
noise1(double x)noise2(double x, double y)noise3(double x, double y, double z)getMinOutput()/getMaxOutput()
The package exports:
- Interpolators:
LinearInterpolator,HermiteInterpolator,CubicInterpolator,StarcastInterpolator - Core:
NoisePlane,NoisePlaneProvider - Providers:
CellularProvider,CellularHeightProvider,Cellularizer,ExponentProvider,FittedProvider,FlatProvider,OctaveProvider,PerlinProvider,ScaledProvider,SeededProvider,SimplexProvider,ValueHermiteProvider,ValueLinearProvider,WarpedProvider,WhiteProvider
loud_texture/ is a Flutter example project that uses loud to render animated procedural materials like stone, cobblestone, sandstone, and dirt.
GPL-3.0 (see LICENSE).