JungleMaterialsBuild
Authoring-time steps of the jungleMaterials package (edit mode), adapted from tropicalMaterials' build:
JungleMaterialsBuild
Authoring-time steps of the jungleMaterials package (edit mode), adapted from tropicalMaterials' build:
importTile(name, pbrGenFolder, opts)turns a generated PBR tile (apbr_genmaterial folder) into<name>_albedo,_normal,_rmand optionally a terrain_mask, reading loose maps when an import never finished.regradeTile(name, opts);wetMask(src, dst, smooth, flatten?)writes a glossy terrain mask for a wet variant (leafLitterWet).writeMaterials()writesmaterials/for every own surface on tropicalMaterials'tropicalSolid/tropicalFoliage;writeTable();writeCollection().bakeTerrainLooks(only?)bakes the painted, toon, lowpoly and pixel albedos of each terrain layer (the engine terrain shades its layers itself).swatches()/clearSwatches();textureMemory().
Build order: textures (CardBaker cards, importTile tiles), materials, table, terrain looks, table again, collection. It finds the package 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
the package's own folder, wherever it is installed: the parent of this module's folder
q(s: string) → string
| arg | type | description |
|---|---|---|
| s | string |
key(s: string) → string
| arg | type | description |
|---|---|---|
| s | string |
writeTable( ) → number
Regenerate JungleMaterialsTable/init.luau: one literal asset.resolve per own material, collection material, texture and shader the resolver uses, 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
| arg | type | description |
|---|---|---|
| folder | string |
mapPng(src: string, map: string) → string
a generated map: the png inside its .texture folder, or the loose png beside it (an import that never finished)
| arg | type | description |
|---|---|---|
| src | string | |
| map | string |
textureFolder(id: string) → string
the folder a texture identity lives in ("groundMaterials.textures.x" / "~.textures.x"), wherever its package is installed
| arg | type | description |
|---|---|---|
| id | string |
planes(id: string, n: number) → void
rgb planes (0..1 sRGB) of a texture at n x n, box-filtered by the decoder
| arg | type | description |
|---|---|---|
| id | string | |
| n | number |
bilerp(p: { [string]: any }, x: number, y: number) → void
wrap-around bilinear sample of a plane set at (x, y) in source texels
| arg | type | description |
|---|---|---|
| p | { [string]: any } | |
| x | number | |
| y | number |
at(xx: number, yy: number) → number
| arg | type | description |
|---|---|---|
| xx | number | |
| yy | number |
mix4(t: { number }) → number
| arg | type | description |
|---|---|---|
| t | { number } |
lum(r: number, g: number, b: number) → number return 0
| arg | type | description |
|---|---|---|
| r | number | |
| g | number | |
| b | number |
bakeTerrainLooks(only: { string }?) →
Bake the painted, toon, lowpoly and pixel looks of every terrain layer (or only the layers named in `only`) into small tiling textures (`terrain_<surface>_<look>_albedo`), since the engine terrain draws its layers with its own shader: painted = the colour blurred into brush patches and gently stepped; toon = flat colour in three close tones; lowpoly = the surface's palette colour with a faint large-scale variation; pixel = 64 texels a tile, posterised, each texel a 4 x 4 block. Then rewrites the table.
| arg | type | description |
|---|---|---|
| only | { string }? | Optional list of terrain layer names to re-bake; nil bakes all ten. |
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 |
importTile(name: string, src: string, opts: TileOpts?) →
Import a generated PBR tile (a pbr_gen material folder) into textures/ as `<name>_albedo`, `<name>_normal`, `<name>_rm` (R occlusion 1, G roughness, B metallic) and optionally `<name>_mask` for terrain layers. The albedo can be graded to a target mean colour. All textures repeat.
| arg | type | description |
|---|---|---|
| name | string | Surface name, e.g. "sandDry". |
| src | string | The generated material folder (holding textures/basecolor.texture ...). |
| opts | TileOpts? | TileOpts. |
shrink(buf: buffer, f: number) → void
optional smaller maps (box-filtered by a power of two) to keep the package in its texture budget
| arg | type | description |
|---|---|---|
| buf | buffer | |
| f | number |
saveMap(suffix: string, buf: buffer, kind: string) → void
| arg | type | description |
|---|---|---|
| suffix | string | |
| buf | buffer | |
| kind | string |
regradeTile(name: string, opts: { target: { number }, contrast: number?, maxValue: number? }) →
Regrade an imported tile's albedo (`textures/<name>_albedo`) in place: stretch its brightness detail around the mean by `contrast` (hue kept), move the mean onto `target` (sRGB 0..255) and clamp every channel to `maxValue` (default 240), so bright surfaces keep visible grain in strong sun.
| arg | type | description |
|---|---|---|
| name | string | Surface name, e.g. "sandDry". |
| opts | { target: { number }, contrast: number?, maxValue: number? } | { target = { r, g, b }, contrast = number?, maxValue = number? } |
wetMask(src: string, dst: string, smooth: number, flatten: number?) → string
Write `textures/<dst>_mask` from `textures/<src>_mask` with its smoothness (A) lifted to at least `smooth` (0..1) and its height (B) flattened toward the middle by `flatten` (0..1): the glossy terrain mask of a wet variant of a layer (leafLitterWet from leafLitter).
| arg | type | description |
|---|---|---|
| src | string | Layer whose mask is copied, e.g. "leafLitter". |
| dst | string | Name of the new layer mask, e.g. "leafLitterWet". |
| smooth | number | Least smoothness, 0..1. |
| flatten | number? | How far the height is pulled to the middle, 0..1. |
writeMaterials( ) →
Write materials/<name>.material for every surface the package ships (JungleMaterials DEFS with `own`): the real look, on tropicalMaterials' tropicalSolid (tiles) or tropicalFoliage (leaves, petals, tufts), with the recipe's textures and properties. Re-running re-authors them in place (same guids).
writeCollection( ) → number
Rewrite jungle.materialCollection/collection.yaml: one entry per material the package ships (materials/), so they appear in materialLibraryKit's Materials.list, picker and swatch gallery.
swatches(opts: { [string]: any }?) → any
Lay out a temporary swatch board: every surface (a sphere, or a standing card for leaves and petals) in a row per look, under one root entity named "jmSwatches". Returns the root, so a capture can frame and isolate it. Replaces an earlier board.
| arg | type | description |
|---|---|---|
| opts | { [string]: any }? | { at = { x, y, z }?, looks = { string }?, surfaces = { string }?, perRow = number? } |
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.
TileOpts = {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.