DesertMaterials
The resolver behind every desert surface name: `DM.get(surface, { look })` returns a material (never nil) for a `Model` or an instanced draw, in the real, painted, toon, lowpoly or pixel look (nil / "auto" follow `DesertLook`). `DM.surfaces()`, `DM.group(s)`, `DM.isCard(s)`, `DM.…
DesertMaterials
The resolver behind every desert surface name: DM.get(surface, { look }) returns a material (never nil) for a Model or an instanced draw, in the real, painted, toon, lowpoly or pixel look (nil / "auto" follow DesertLook). DM.surfaces(), DM.group(s), DM.isCard(s), DM.palette(s) (linear lowpoly colour), DM.source(s, opts) (own: / installed: / runtime: / fallback:), DM.footstep(s) (sand, softSand, gravel, rock, stone, mud, water, wood, grass, salt), DM.terrainLayers() (the 14 ground layers) and DM.terrainLayer(name, look) (a terrain.write surfaces record: albedo, normal, mask texture identities, tiling in metres, linear tint). Real looks are the package's own materials, a few installed collection materials, or runtime recipes on the package's desertRock / desertSand shaders and tropicalMaterials' shaders; the four stylised looks are built at runtime on tropicalStylised from the same textures. desertProps and desertKit call it; so can any scene.
local DM = require("desertMaterials.DesertMaterials")
local rock = DM.get("sandstoneVarnished") -- real look, follows DesertLook when look is nil
local leaf = DM.get("palmFrondDate", { look = "toon" })
local layer = DM.terrainLayer("sandDune", "painted")
print(DM.footstep("sandSlipFace")) -- softSand
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
hexLinear(hex: string) → void
| arg | type | description |
|---|---|---|
| hex | string |
lin(c: { number }) → void
| arg | type | description |
|---|---|---|
| c | { number } |
merge(a: { [string]: any }, b: { [string]: any }?) → void
| arg | type | description |
|---|---|---|
| a | { [string]: any } | |
| b | { [string]: any }? |
borrow(prefix: string, name: string, tint: { number }?, kind: string?) → Recipe
borrowed texture set: prefix .. name .. _albedo / _normal / _rm (or _mask for ground textures)
| arg | type | description |
|---|---|---|
| prefix | string | |
| name | string | |
| tint | { number }? | |
| kind | string? |
ground(name: string, base: Recipe, palette: string, foot: string, extra: { [string]: any }?) → Def
a ground layer: own textures (once generated) over a borrowed placeholder
| arg | type | description |
|---|---|---|
| name | string | |
| base | Recipe | |
| palette | string | |
| foot | string | |
| extra | { [string]: any }? |
solid(group: string, name: string, base: Recipe?, palette: string, foot: string, extra: { [string]: any }?) → Def
| arg | type | description |
|---|---|---|
| group | string | |
| name | string | |
| base | Recipe? | |
| palette | string | |
| foot | string | |
| extra | { [string]: any }? |
cardDef(group: string, name: string, base: Recipe, props: { [string]: any }, palette: string, foot: string, extra: { [string]: any }?) → Def
| arg | type | description |
|---|---|---|
| group | string | |
| name | string | |
| base | Recipe | |
| props | { [string]: any } | |
| palette | string | |
| foot | string | |
| extra | { [string]: any }? |
inst(group: string, mats: { string }, base: Recipe, palette: string, foot: string, extra: { [string]: any }?) → Def
| arg | type | description |
|---|---|---|
| group | string | |
| mats | { string } | |
| base | Recipe | |
| palette | string | |
| foot | string | |
| extra | { [string]: any }? |
guidOf(ref: any) → string
| arg | type | description |
|---|---|---|
| ref | any |
texSet(def: Def) → TexSet
| arg | type | description |
|---|---|---|
| def | Def |
has(s: string) → string
| arg | type | description |
|---|---|---|
| s | string |
tintLin(t: { number }?) → void
| arg | type | description |
|---|---|---|
| t | { number }? |
alive(ck: string, h: any) → boolean
| arg | type | description |
|---|---|---|
| ck | string | |
| h | any |
build(key: string, content: { [string]: any }) → any
| arg | type | description |
|---|---|---|
| key | string | |
| content | { [string]: any } |
texRef(id: string?) → string
| arg | type | description |
|---|---|---|
| id | string? |
shaderFor(def: Def) → void
the shader a recipe draws on, and the shader properties that go with it
| arg | type | description |
|---|---|---|
| def | Def |
_realContent(surface: string) → void
the material content of the real look (also what DesertMaterialsBuild.writeMaterials writes)
| arg | type | description |
|---|---|---|
| surface | string |
stylised(surface: string, def: Def, look: string) → any
| arg | type | description |
|---|---|---|
| surface | string | |
| def | Def | |
| look | string |
resolveFresh(surface: string, look: string) → void
| arg | type | description |
|---|---|---|
| surface | string | |
| look | string |
get(surface: string, opts: { look: string? }?) → any
Resolve a desert surface to a material for a look. Never nil: an unknown look falls back to "real", nil or "auto" follows DesertLook.get(), an unknown surface answers a neutral driftwood. Real looks are material assets (own or collection) or runtime recipes; painted, toon, lowpoly and pixel are runtime materials on tropicalStylised built once per machine.
| arg | type | description |
|---|---|---|
| surface | string | A surface name from DM.surfaces(), e.g. "sandDune", "palmFrondDate", "mudBrick". |
| opts | { look: string? }? | { look = "real"|"painted"|"toon"|"lowpoly"|"pixel"|"auto" }; optional. |
examples
local mat = DM.get("sandstoneVarnished", { look = "toon" })source(surface: string, opts: { look: string? }?) → string
Where DM.get's answer came from: "own:<material>", "installed:<identity>", "runtime:<key>" (key ends |o when built from this package's textures, |b from borrowed ones, |w for water) or "fallback:<identity>".
| arg | type | description |
|---|---|---|
| surface | string | A surface name. |
| opts | { look: string? }? | Same as DM.get. |
examples
print(DM.source("sandDune")) -- own:sandDunesurfaces( ) →
Every surface name this module resolves, in catalogue order (14 terrain layers first).
group(surface: string) → string
The group a surface belongs to: ground, rock, stone, built, bark, leaf, flower, fruit, cactus, camp or water.
| arg | type | description |
|---|---|---|
| surface | string | A surface name. |
isCard(surface: string) → boolean
True when the surface is an alpha-cut, two-sided leaf, tuft or tangle card that sways by vertex alpha.
| arg | type | description |
|---|---|---|
| surface | string | A surface name. |
palette(surface: string) →
The surface's flat lowpoly palette colour as linear { r, g, b, a }.
| arg | type | description |
|---|---|---|
| surface | string | A surface name. |
footstep(surface: string) → string
The footstep class of a surface: sand, softSand, gravel, rock, stone, mud, water, wood, grass or salt. Unknown surfaces answer "sand".
| arg | type | description |
|---|---|---|
| surface | string | A surface name (a terrain layer or a prop surface). |
examples
print(DM.footstep("sandSlipFace")) -- softSandterrainLayers( ) →
The 14 ground surfaces that are terrain layers.
terrainLayer(name: string, look: string?) →
A terrain layer record for the engine terrain's `surfaces` input: { name, albedo, normal?, mask?, tiling, tint }. albedo / normal / mask are texture identities, tiling is metres per repeat, tint a linear { r, g, b }. Stylised looks hand out the package's baked per-look albedo (the engine terrain shades its layers itself); the real look the package's own tile (or, until it ships, the borrowed tile tinted toward the surface).
| arg | type | description |
|---|---|---|
| name | string | A terrain layer (DM.terrainLayers()). |
| look | string? | A look; nil/"auto" follows DesertLook. |
examples
local rec = DM.terrainLayer("sandDune", "toon")terrainAlbedo(name: string, look: string?) → string
The guid of a terrain layer's colour texture in a stylised look (painted, toon, lowpoly, pixel), for shading an already cooked ground in that look at runtime. Every look's textures share one size, so the eight of a ground make one texture array. Nil for `real` (the cooked ground already holds it) or an unknown name.
| arg | type | description |
|---|---|---|
| name | string | A terrain layer (DM.terrainLayers()). |
| look | string? | A look; nil/"auto" follows DesertLook. |
examples
local g = DM.terrainAlbedo("sandDune", "toon")refresh( ) → void
Drop the resolution cache so the next DM.get rebuilds.
_catalogue( ) →
Everything DesertMaterialsBuild.writeTable() turns into literal resolves: own material names, collection materials, borrowed texture identities, own texture base names.
Recipe = {Def = {TexSet = { albedo: string?, normal: string?, rm: string?, mask: string?, tint: { number }?, own: boolean }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.