Expand description
Procedural noise for scripts, shaders-on-the-CPU and generated textures.
Everything is a pure function of its inputs (no global state), so it is safe to call from
script libraries and always deterministic for a given seed.
use kvas_engine::noise::{Noise, NoiseKind};
let (x, z) = (1.0, 2.0);
let n = Noise { kind: NoiseKind::Ridged, frequency: 0.8, octaves: 5, ..Default::default() };
let height = n.sample2(x, z); // -1..1
let mask = n.sample01(x, z, 0.0); // 0..1Structs§
- Noise
- Full-featured fractal noise.
sample*return -1..1,sample01*return 0..1. - Noise
Texture - A texture description that fits in
MeshRenderer.texture, e.g. from a script:mr.texture = NoiseTexture::new(Noise::new(NoiseKind::Worley)).key();
Enums§
- Noise
Kind - Basic noise flavours; all can be combined with fractal octaves and domain warping.
Constants§
- TEXTURE_
PREFIX - Prefix for serialized procedural noise texture keys.