Optionalsettings: {configuration; any Noise setting
(type, seed, frequency/scale, octaves, gain/persistence,
lacunarity, fractalType, domain-warp settings) is forwarded when no
noise instance is given.
Optionalanimated?: booleansample in 3D (getNoise3d)
using an internal time as the third axis, advanced by NoiseTexture2d#update
OptionalasNormalMap?: booleanencode as a normal map
OptionalbumpStrength?: numbernormal steepness when asNormalMap
OptionalcolorRamp?: anymap the noise value to a color
Optionalheight?: numberbaked texture height in pixels
Optionalinvert?: booleaninvert the noise value (1 - v)
Optionalnoise?: Noisean existing Noise to bake; when omitted one is built from the forwarded settings
Optionalseamless?: booleantile cleanly in both axes
OptionalseamlessBlendSkirt?: numberedge blend band width
as a fraction (0..1) of the smaller dimension, when seamless
Optionalspeed?: numberanimation speed in noise z-units per
second (only used while animated)
Optionalwidth?: numberbaked texture width in pixels
sample the field in 3D using time as the third axis
encode the field as a tangent-space normal map
normal steepness when asNormalMap
optional color ramp applied to the noise value
baked texture height in pixels
invert the noise value
the noise field baked by this texture
tile cleanly in both axes
edge blend band width (0..1 of the smaller dimension)
animation speed in noise z-units per second
the current animation time (third sampling axis)
baked texture width in pixels
The current content revision, bumped on every NoiseTexture2d#bake.
Also stamped on the baked canvas (getTexture().version) so the renderer
re-uploads the GPU texture only when it actually changed.
(Re)bake the texture from the current settings into the (reused) output canvas. Called once on construction; NoiseTexture2d#update calls it again per frame for animated textures.
this texture for chaining
Release the baked canvas. The texture must not be used after destroy.
the baked texture canvas
Advance an animated texture by dt milliseconds and re-bake it. The
re-bake bumps the texture's version, so the renderer re-uploads the GPU
texture automatically on the next draw — no renderer/app handle needed.
This is NOT auto-called by the engine; drive it from your own update loop
(e.g. Stage#update) for animated textures. No-op when not animated.
elapsed time since the last update, in milliseconds
this texture for chaining
A Texture2d that bakes a Noise field into a drawable canvas — usable directly as a sprite image, a normal map, an image layer, or a custom shader sampler.
The bake runs on the CPU (renderer-agnostic, works under both the Canvas and WebGL backends) and produces an
HTMLCanvasElementreturned by NoiseTexture2d#getTexture. Three output modes:[0, 255].With
seamless: truethe texture's edges are cross-faded so it tiles with a much-reduced seam (an approximate, not pixel-exact, wrap);seamlessBlendSkirtcontrols how wide that edge blend band is. Withanimated: truethe field is sampled in 3D (getNoise3d) using an internaltimeas the third axis — call NoiseTexture2d#update from your update loop to evolve it. Each re-bake bumps aversionthe renderer reads, so the GPU texture re-uploads automatically (and only when it actually changed — the three.jsTexture.needsUpdatemodel).Note: live re-upload is currently wired through the lit normal-map pipeline (Sprite#normalMap + Light2d). An
animatedtexture used as a plain colorimagebakes a static snapshot — the color texture cache does not yet honorversion— so animate normals, not albedos, for now.Example