pub struct TextureRecipe {Show 16 fields
pub kind: String,
pub scale: f32,
pub octaves: u32,
pub seed: u32,
pub colors: Vec<[f32; 3]>,
pub roughness: [f32; 2],
pub smoothness: Option<[f32; 2]>,
pub metallic: [f32; 2],
pub height: f32,
pub ao: f32,
pub size: u32,
pub over: Option<Box<TextureRecipe>>,
pub mix: f32,
pub mask_scale: f32,
pub mask_seed: u32,
pub triplanar: f32,
}Expand description
One procedural material: a pattern drives everything. The pattern’s value (0–1 per texel) indexes the color ramp, lerps roughness/metallic between their two ends, acts as a height field for the normal map, and darkens crevices for ambient occlusion.
Fields§
§kind: StringPattern: fbm (organic noise) · voronoi (stone cells + cracks) ·
bricks · wood (warped plank grain) · veins (marble) ·
checker · flat.
scale: f32Pattern repeats across the tile (features per tile edge). Default 4.
octaves: u32fbm octaves (detail). Default 4.
seed: u32Determinism seed — same recipe, same texels, everywhere. Default 0.
colors: Vec<[f32; 3]>Color ramp stops, evenly spaced over the pattern value. 1+ colors.
roughness: [f32; 2]Roughness at pattern value 0 → 1. Default [0.9, 0.9].
smoothness: Option<[f32; 2]>Unity’s spelling of the same dial, if you think that way: smoothness
= 1 − roughness. When present it WINS over roughness (see
TextureRecipe::rough_band) — one material vocabulary, two accents.
metallic: [f32; 2]Metallic at pattern value 0 → 1. Default [0, 0].
height: f32Normal-map strength — the pattern read as a height field. 0 = flat.
ao: f32Crevice darkening strength (bakes into the occlusion channel). 0 = none.
size: u32Baked texture side in texels. Default 256, clamped to MAX_SIZE.
over: Option<Box<TextureRecipe>>A second recipe layered OVER this one, blended by an fbm mask — moss over granite, rust over iron, plaster over brick. One level deep.
mix: f32How much of the overlay shows (0 none → 1 full). Default 0.5.
mask_scale: f32Feature scale of the blend mask (default 3).
mask_seed: u32Seed of the blend mask.
triplanar: f32World-space triplanar sampling in the browser (uv repeats per metre; 0 = classic UV sampling). Kills projection seams on carved shapes — set ~0.5 for architecture. Exported GLBs keep UVs (glTF has no triplanar), so exports still look right, just with seams.