DesertMaterialsBuild
Authoring-time steps of the desertMaterials package (edit mode only; nothing at runtime calls it). `importTile(name, pbrFolder, opts)` turns a generated PBR tile into the package's `<name>_albedo / _normal / _rm / _mask` textures: grades the colour to a target mean, flattens the…
DesertMaterialsBuild
Authoring-time steps of the desertMaterials package (edit mode only; nothing at runtime calls it). importTile(name, pbrFolder, opts) turns a generated PBR tile into the package's <name>_albedo / _normal / _rm / _mask textures: grades the colour to a target mean, flattens the normal (slip faces) and bakes tiling procedural wind ripples into the normal and terrain-mask height (crest count per tile, asymmetric stoss/lee profile, wandering crests, trough shading, coarse grit on crests). bakeCard(name, picture, opts) keys a leaf or tuft painted on magenta into a fitted, graded, halo-free card with a normal map (tropicalMaterials' CardBaker does the keying). writeMaterials() authors materials/<own>.material from the resolver's real-look recipe, writeTable() regenerates DesertMaterialsTable, bakeTerrainLooks(only?) bakes the painted / toon / lowpoly / pixel albedos of the 14 terrain layers, swatches(opts) / clearSwatches() lay out a temporary swatch board (default at x = 5000), and textureMemory() counts the GPU memory of the package's textures. Build order: textures, then materials, then the table. It finds the package's folder from its own location, so it runs wherever the package is installed.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
packageRoot( ) → string
q(s: string) → string return string
| arg | type | description |
|---|---|---|
| s | string |
key(s: string) → string
| arg | type | description |
|---|---|---|
| s | string |
names(dir: string) → void
| arg | type | description |
|---|---|---|
| dir | string |
baseName(p: string) → string return string
| arg | type | description |
|---|---|---|
| p | string |
save(name: string, w: number, h: number, bytes: buffer, kind: string, wrap: string?) → any
Write rgba8 bytes as a texture asset in this package's textures/ (PNG source kept). kind: "color" | "normalMap" | "mask"; wrap "clamp" (cards) or "repeat" (tiles).
| arg | type | description |
|---|---|---|
| name | string | |
| w | number | |
| h | number | |
| bytes | buffer | |
| kind | string | |
| wrap | string? |
writeTable( ) → number
Regenerate DesertMaterialsTable/init.luau: one literal asset.resolve per own material and texture that exists, per collection material and borrowed texture, per shader, plus the baked terrain looks found under textures/terrain_*.
loadRgba(path: string, size: number) → void
| arg | type | description |
|---|---|---|
| path | string | |
| size | number |
pngOf(folder: string) → string
The image file inside a texture folder (its source.* or first png/jpg).
| arg | type | description |
|---|---|---|
| folder | string |
textureFolder(id: string) → string
the folder a texture identity lives in, wherever its package is installed
| arg | type | description |
|---|---|---|
| id | string |
lum(r: number, g: number, b: number) → number return 0
| arg | type | description |
|---|---|---|
| r | number | |
| g | number | |
| b | number |
hash(x: number, y: number, s: number) → number
tiling hash noise in [0,1) on an integer lattice of period p
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| s | number |
vnoise(x: number, y: number, p: number, s: number, py: number?) → number
| arg | type | description |
|---|---|---|
| x | number | |
| y | number | |
| p | number | |
| s | number | |
| py | number? |
at(i: number, j: number) → number return hash
| arg | type | description |
|---|---|---|
| i | number | |
| j | number |
importTile(name: string, src: string, opts: TileOpts?) →
Import a generated PBR tile (a pbr_gen material folder holding textures/basecolor, normal, roughness, metalness) into textures/ as `<name>_albedo`, `<name>_normal`, `<name>_rm` (R occlusion 1, G roughness, B metallic) and optionally `<name>_mask`. Grades the albedo, can flatten the normal and add tiling procedural wind ripples (two-scale sand ripples are baked here, since the engine terrain draws only the textures).
| arg | type | description |
|---|---|---|
| name | string | Texture base name, e.g. "sandDune". |
| src | string | The generated material folder. |
| opts | TileOpts? | TileOpts. |
heightAt(x: number, y: number) → void
| arg | type | description |
|---|---|---|
| x | number | |
| y | number |
H(x: number, y: number) → number return hbuf
| arg | type | description |
|---|---|---|
| x | number | |
| y | number |
shrink(buf: buffer, fct: number) → void
| arg | type | description |
|---|---|---|
| buf | buffer | |
| fct | number |
saveMap(suffix: string, buf: buffer, kind: string) → void
| arg | type | description |
|---|---|---|
| suffix | string | |
| buf | buffer | |
| kind | string |
bakeCard(name: string, srcPath: string, opts: CardOpts?) →
Bake one card from a picture painted on a flat key colour (magenta): key it to alpha, fit it to w x h (base flipped to v = 0), grade its cut-out mean to `target` (sRGB 0..255), bleed the margin, save `<name>_albedo` and `<name>_normal` into this package. Uses tropicalMaterials' CardBaker for the keying.
| arg | type | description |
|---|---|---|
| name | string | Surface name, e.g. "palmFrondDate". |
| srcPath | string | The picture file. |
| opts | CardOpts? | CardOpts. |
writeMaterials( ) →
Write materials/<own>.material for every surface whose own textures are shipped: the real look with its shader, textures and properties (DesertMaterials._realContent). Re-running re-authors them in place.
writeCollection( ) → number
Rewrite desert.materialCollection/collection.yaml: one entry per material the package ships, with kind, style, tile size, roughness / metallic range, measured texture memory (textureKB, the cost) and tags, so they appear in materialLibraryKit's Materials.list, picker and swatch gallery.
planes(id: string, n: number) → void
rgb planes (0..1 sRGB) of a texture at n x n
| arg | type | description |
|---|---|---|
| id | string | |
| n | number |
bilerp(p: { [string]: any }, x: number, y: number) → void
| arg | type | description |
|---|---|---|
| p | { [string]: any } | |
| x | number | |
| y | number |
at(xx: number, yy: number) → number return
| arg | type | description |
|---|---|---|
| xx | number | |
| yy | number |
mix4(t: { number }) → number
| arg | type | description |
|---|---|---|
| t | { number } |
bakeTerrainLooks(only: { string }?) →
Bake the painted, toon, lowpoly and pixel looks of every terrain layer (or those in `only`) into small tiling albedos `terrain_<layer>_<look>_albedo` (the engine terrain shades its layers itself): painted = soft brush patches in stepped tones keeping the large ripple shading; toon = the mean colour in three close flat tones with the ripple bands kept as one light / one dark tone; lowpoly = the palette colour with faint large variation; pixel = 64 texels a tile in 4 x 4 blocks, brightness posterised with hue kept. Then rewrites the table.
| arg | type | description |
|---|---|---|
| only | { string }? | Optional list of layer names. |
save(look: string, n: number, f: (x: number, y: number) → void
| arg | type | description |
|---|---|---|
| look | string | |
| n | number | |
| f | (x: number, y: number |
sat(r: number, g: number, b: number, s: number) → void
| arg | type | description |
|---|---|---|
| r | number | |
| g | number | |
| b | number | |
| s | number |
tinted(p: { [string]: any }) → void
| arg | type | description |
|---|---|---|
| p | { [string]: any } |
swatches(opts: { [string]: any }?) → any
Lay out a temporary swatch board: every surface (a sphere, a standing card for leaves) in a row per look, under a root entity "dmSwatches". Replaces an earlier board.
| arg | type | description |
|---|---|---|
| opts | { [string]: any }? | { at = { x, y, z }?, looks = { string }?, surfaces = { string }?, perRow = number?, model = string? } |
clearSwatches( ) → void
Remove the swatch board laid out by swatches().
textureMemory( ) →
GPU memory of every texture in the package's textures/ folder, in bytes (1 byte a texel for BC7/UASTC, x 4/3 for mipmaps), with a per-texture list.
RippleOpts = {TileOpts = {CardOpts = { w: number?, h: number?, margin: number?, flipV: boolean?, target: { number }?, sat: number?, normalStrength: number?, maxValue: number? }Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.