Skip to content
Shapemetry

Model - textures[]

Every method of the textures[] lane. Each step of a textures[] entry returns a texture, and the lane's entries are addressed by the identity schema/lanes.ts declares for it.

MethodDescriptionArgTypeDefaultMeaning
bandpassBandpass — Filter — keep only spatial frequencies between low and high (FFT; needs power-of-two dimensions).lownumber0Lowest frequency kept (cycles per tile).
highnumber64Highest frequency kept (cycles per tile).
blendBlend — Filter — combine the running image with another chain's output, optionally through a mask.sourcestring''textures[] chain key to blend in (quote literals).
modestring'add'Blend mode.
amountnumber1Blend weight 0..1.
maskstring''textures[] chain key whose values weight the blend (quote literals).
blurBlur — Filter — box/gaussian softening.radiusnumber1Blur radius in PIXELS.
cellsCells — Source — the per-unit-variation grid (brick / tile / plank): split the tile into cells, carve the joints, then evaluate value with u/v = LOCAL cell coordinates and k = the cell's stable id.patternstring'running'Cell bond.
columnsnumber4Cells across the tile.
rowsnumber8Cells down the tile.
offsetnumber0.5Row offset as a fraction of a cell ('running' bond) — 0.5 = classic brick, 0 = stack bond.
jointnumber0.01Joint thickness as a fraction of the TILE (same both axes).
valuestring1Per-pixel formula (u, v, t, k + math builtins) — compiled once, evaluated for every pixel. u/v = LOCAL cell coordinates, k = the cell's stable id — 0.8 + 0.2 * rand(k, 3) tints every brick differently.
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
channelsChannels — Filter — pack up to four referenced chains into RGBA. May start a stream on its own (the only filter that can). Empty channel → 0, empty alpha → 1.redstring''textures[] chain key for the red channel (quote literals).
greenstring''textures[] chain key for the green channel.
bluestring''textures[] chain key for the blue channel.
alphastring''textures[] chain key for the alpha channel.
distanceDistance Field — Filter — per-pixel distance to the nearest pixel above threshold, clamped and normalized to 0..1 (two-pass chamfer, O(n)).thresholdnumber0.5Values above this count as the mask.
maxDistancenumber32Distance in PIXELS that maps to 1.
fieldField — Source — evaluate one per-pixel formula over the tile. The general-purpose maths source (gradients, stripes, rings, anything closed-form).valuestring0.5Per-pixel formula (u, v, t, k + math builtins) — compiled once, evaluated for every pixel. u/v = tile coordinates 0..1.
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
gradientMapGradient Map — Filter — map the scalar stream through a color ramp.stopsobject[{t:0, color:'#000000'}, {t:1, color:'#ffffff'}]Ramp stops [{t, color}] — t in 0..1.
imageImage — Source — a pre-loaded bitmap resampled into the stream. The bytes must already be loaded (Store pre-load / editor upload); evaluation never fetches.urlurl''A url-method parameter KEY, or a direct https:/data: URI.
channelstring'rgba''rgba' = color stream; 'luma' = scalar stream (feeds the scalar-only filters).
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
isolinesIsolines — Filter — turn sin(density × value) into ring boundaries: contour lines through any scalar field.densitynumber20Rings across the value range.
blurnumber0.08Ring softness — 0 = hard edge.
levelsLevels — Filter — gamma, gain, offset and inversion on the scalar stream.gammanumber1Gamma exponent — <1 brightens midtones.
multiplynumber1Gain applied after gamma.
addnumber0Offset applied after gain.
invertbinary01 = invert the stream.
noiseNoise — Source — deterministic value / fbm / worley noise. A whole-number scale tiles seamlessly (the lattice is embedded on a torus).typestring'fbm'Noise family.
scalenumber8Lattice cells per tile — a WHOLE number keeps the tile seamless.
octavesnumber4Octaves summed (fbm), 1–8.
seednumber1Deterministic offset — the same seed always produces the same image.
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
normalMapNormal Map — Filter — read the stream as a height field and emit a tangent-space normal map.strengthnumber1Slope multiplier — higher = deeper relief.
splatterSplatter — Source — scatter a stamp formula across the tile with per-stamp size / rotation / intensity jitter. Speckle, gravel, foliage.stampstringmax(0, 1 - 2 * hypot(u, v))Per-pixel formula (u, v, t, k + math builtins) — compiled once, evaluated for every pixel. u/v = coordinates within the stamp, k = stamp index.
countnumber64How many stamps to scatter.
stampSizenumber0.12Stamp size as a fraction of the tile.
sizeJitternumber0.3Random size variation 0..1.
rotationJitternumber1Random rotation 0..1 (1 = any angle).
intensityJitternumber0.3Random brightness variation 0..1.
seednumber1Deterministic scatter seed.
modestring'max'How overlapping stamps combine.
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
strokesStrokes — Source — sweep a parametric path (x(t), y(t)) and stamp a stroke along it, optionally in several copies. Grain, hatching, fibres.xstringtPer-pixel formula (u, v, t, k + math builtins) — compiled once, evaluated for every pixel. t = path parameter, k = copy index.
ystring0.5Per-pixel formula (u, v, t, k + math builtins) — compiled once, evaluated for every pixel. t = path parameter, k = copy index.
t0number0Path parameter at the start of the sweep.
t1number1Path parameter at the end of the sweep.
samplesnumber800Points sampled along each stroke.
copiesnumber1How many strokes to draw — k is the copy index.
strokeWidthnumber0.01Stroke half-width as a fraction of the tile.
intensitynumber1Stroke brightness 0..1.
widthnumberimageWidthOutput width in PIXELS. Defaults to the chain's imageWidth builtin.
heightnumberimageHeightOutput height in PIXELS. 0 = derive from the physical aspect (lengthY/lengthX).
tintTint — Filter — colorize the scalar stream by interpolating between two colors.lowcolor'#000000'Color at value 0.
highcolor'#ffffff'Color at value 1.
transformTransform — Filter — affine resample (rotate / scale / offset / flip), bilinear, honoring the chain's declared wrap out of bounds.rotateangle0Rotation in degrees.
scaleobject1Uniform number, or [scaleX, scaleY].
offsetobject[0, 0][offsetX, offsetY] as a fraction of the tile.
flipXbinary01 = mirror horizontally.
flipYbinary01 = mirror vertically.
warpWarp — Filter — displace the running image by another chain's values.sourcestring''textures[] chain key supplying the displacement (quote literals).
strengthnumber0.05Displacement as a fraction of the tile.
Last updated: 📖 6 min readEdit on GitHub