# tropicalProps
**60 kinds of tropical island props for any world, each placed with one component:** seven palms (straight, leaning and wind-bent coconut palms, a fan palm, a young palm, a palm clump and a pandanus), beach grass, sea oats and flowering bushes, palm litter, beach rocks, cliffs and sea stacks, coral and sea grass, shells and driftwood, and a modular weathered wooden pier. Every prop has near, middle and far versions, 2-3 seeded shapes, and draws in five looks (`real`, `painted`, `toon`, `lowpoly`, `pixel`) that switch world-wide with one call. Materials come from its dependency `tropicalMaterials`.
## Quick start
Install `tropicalProps` (it brings `tropicalMaterials`). In any world:
```luau
-- a leaning beach palm at the origin
local palm = entity.spawn("palm", { position = { 0, 0, 0 } })
palm.component.add("tropicalProps.TropicalProp", { kind = "palmCoconutLeaning", variant = 2 })
-- a hibiscus bush beside it, shape and turn picked from a seed (for scattering)
entity.spawn("bush", { position = { 3, 0, 1 } }).component.add("tropicalProps.TropicalProp", { kind = "hibiscusBush", seed = 41 })
-- switch every prop that follows the world look (look = "auto", the default) to cartoon:
require("tropicalMaterials.TropicalLook").set("toon")
-- or, synced to every player, put the look setting on one entity of the scene:
entity.spawn("Island Look").component.add("tropicalMaterials.TropicalLookSetting", { look = "lowpoly" })
```
Add a `tropicalProps.PropGallery` component to any entity to see every kind side by side, one band per look (`looks` and `kinds` narrow it, e.g. `{ looks = "real", kinds = "palm" }`).
The package works from wherever it is installed (the world root or `deps/<world>/`): its own files reach each other with `~.` names, its dependency with `~tropicalMaterials.`, and the bake helpers find their folder from their own location.
## Guides
Two guides ship inside the package (`guides` tool, `man`, or the Docs panel):
- **How do I add palm trees, beach plants, rocks, coral and a wooden pier to my world?** Placing a prop, every kind by family, variants and seeds, looks and switching them, colliders, detail, and building a pier with `pierLayout` or piece by piece.
- **Make a palm-fringed beach corner with a short pier.** From an empty world to a sand-and-shallows beach corner with palms, plants, rocks, shells and a pier, step by step.
## TropicalProp
Builds one child entity per part (`Model`, swapped to its cheaper versions as the prop shrinks on screen) and its static colliders, all temporary and rebuilt from the synced fields, so every peer builds the same prop and a reload rebuilds it. Changing any field rebuilds.
| Field | Default | Meaning |
|---|---|---|
| `kind` | `palmCoconutStraight` | any kind `Props.kinds()` lists (tables below) |
| `look` | `auto` | `auto` follows `TropicalLook` (the world-wide switch); or `real`, `painted`, `toon`, `lowpoly`, `pixel` |
| `variant` | `1` | baked shape, 1..n (wraps); used when `seed` is 0 |
| `seed` | `0` | non-zero: picks the variant and a yaw turn from the seed (scattering) |
| `detail` | `auto` | `auto` picks near / mid / far by screen size (one test per prop, every 6 frames); `near`, `mid` or `far` pins one |
| `collide` | `true` | build the colliders (tagged with the attribute `tropicalSurface` = the entry's footstep surface) |
Looks: `real`, `painted` and `pixel` draw the same geometry under that look's material; `toon` draws a chunkier bake (fewer, broader fronds and leaves, stacked-segment trunks, smoother rocks); `lowpoly` a faceted flat-shaded bake.
## Kinds
### Palms (category `palm`, surface `wood`)
| Kind | What it is |
|---|---|
| `palmCoconutStraight` | Tall straight coconut palm, 12-16 m: ringed tapering trunk on a flared root ball, 15-18 arching pinnate fronds with drooping tips, coconuts, dry fronds hanging under the crown |
| `palmCoconutLeaning` | Beach coconut palm leaning 38-52 degrees out toward +Z (the sea), curving back up toward the light |
| `palmWindBent` | Upright at the root, bowing over toward +Z, every frond swept downwind |
| `palmFan` | Bismarck-like fan palm: stout trunk, round crown of pleated split-tipped fans on long petioles |
| `palmYoung` | 2-4 m young coconut palm: upright fronds from a trunk stub, often sprouting from its nut |
| `palmCluster` | 3-4 coconut palms of different heights leaning apart from one base, beach grass at their feet |
| `pandanus` | Screwpine: stilt roots, forking arms with spiral tufts of keeled strap leaves, orange fruit |
### Plants, bushes and palm litter
| Kind | Category | What it is |
|---|---|---|
| `beachGrass` | grass | A patch of 3-5 beach grass tufts (cards) |
| `seaOats` | grass | Dune grass with tall straw stalks and nodding seed heads |
| `seaGrape` | bush | Rounded 1-2 m coastal shrub of big round leaves (a few red), hanging grape bunches |
| `beachMorningGlory` | groundcover | Runners creeping over the sand with notched leaves and purple funnel flowers |
| `spiderLily` | flower | Strap-leaf rosette with an umbel of white spidery flowers |
| `tropicalUndergrowth` | bush | Elephant-ear leaves on long petioles and torn banana leaves |
| `hibiscusBush` | bush | Dense dome of glossy leaves with big red flowers |
| `bougainvilleaBush` | bush | Mound of small leaves smothered in magenta bracts |
| `fernTropical` | fern | Shuttlecock of arching pinnate fronds |
| `coconut` | litter | One fallen coconut: v1 brown husk, v2 green, v3 sprouting |
| `coconutPile` | litter | A heap of 6-9 husks and green nuts (sphere collider) |
| `palmFrondFallen` | litter | A fallen dry frond lying on the sand |
### Shore (rocks, cliffs, sea, litter, pier)
| Kind | Category | What it is |
|---|---|---|
| `rockBeach` | rock | Smooth sea-worn grey-brown boulder with a wet foot |
| `rockBasalt` | rock | Dark angular columnar basalt boulder |
| `rockLimestone` | rock | Pale pitted karst limestone rock |
| `rockMossy` | rock | Boulder under a cap of moss |
| `rockCluster` | rock | A big boulder with 2-4 smaller rocks around it |
| `rockShelfTidePool` | rock | Flat wet rock shelf with tide pools, algae, urchins, anemones, a red starfish (walkable) |
| `pebbleScatter` | rock | Loose pebbles over a small patch (no collider) |
| `cliffWall` | cliff | 12 m wide, 11-19 m layered volcanic cliff facing +Z; tiles along X |
| `cliffSpire` | cliff | Sea stack 8.5-14.5 m with a wave-cut notch and mossy cap |
| `cliffBoulderPile` | cliff | Scree fan of angular blocks at a cliff foot |
| `coralBrain` | coral | Brain coral dome |
| `coralStaghorn` | coral | Branching staghorn coral |
| `coralTable` | coral | Broad flat table coral on a stalk (collider) |
| `coralFinger` | coral | Mound of stubby finger coral |
| `coralPink` | coral | Pink cauliflower coral |
| `seaFan` | coral | Flat lattice sea fan (card, sways) |
| `coralCluster` | coral | Mixed reef head on a rubble mound |
| `seaGrass` | seagrass | Patch of swaying ribbon sea-grass |
| `kelpClump` | seagrass | Tall brown kelp stipes with blades |
| `driftwoodLog` | litter | Bleached driftwood log with a root ball (collider) |
| `driftwoodBranch` | litter | Forked bleached branch on the sand |
| `shellConch` | litter | Queen conch with a pink lip |
| `shellCowrie` | litter | Glossy cowrie |
| `shellScallop` | litter | Ribbed scallop valve |
| `shellScatter` | litter | A few mixed shells strewn over the sand |
| `starfish` | litter | Five-armed sea star (v1-2 orange, v3 red) |
| `seaweedStrand` | litter | Tangle of tide-line wrack |
| `seaweedLine` | litter | 2-3 m strip of wrack along X with twigs |
| `pierDeck` | pier | 2 x 2.4 m deck section, deck top y = 0 |
| `pierDeckBroken` | pier | Deck section with missing and snapped planks |
| `pierPost` | pier | 4 m pile post with rope lashing |
| `pierRailing` | pier | 2 m railing with an X brace |
| `pierLadder` | pier | Swim ladder over a deck edge |
| `pierSteps` | pier | Landing steps down to the sand (ramp collider) |
| `pierEnd` | pier | 4 x 4 m end platform with bollards |
| `pierHut` | pier | Small thatched gazebo |
| `bollard` | pier | Mooring bollard |
| `lantern` | pier | Lantern post (point-light hook `ShoreCatalog.LIGHTS.lantern`) |
| `rowboat` | pier | Small wooden rowboat, origin at the waterline |
| `signpost` | pier | Weathered signpost (label anchor `ShoreCatalog.SIGN_FACE`) |
| `lookoutDeck` | pier | Raised 4 x 4 m viewing platform open toward +Z |
Coral and sea grass carry `underwater = true` in their entries.
## Props API
```luau
local Props = require("tropicalProps.Props") -- "~.Props" inside the package
Props.kinds() -> { string } -- every kind, registration order
Props.kindsOf(category) -> { string } -- "palm", "bush", "rock", "coral", "pier", ...
Props.info(kind) -> Entry? -- { kind, category, variants, radius, height, collider?, surface?, underwater?, description, trunks? }
Props.parts(kind, { look?, variant?, lod? }) -> { { mesh, material } } -- same parts, same order at every LOD
Props.normalize(kind, opts) -> opts
Props.register(entry, partsFn) -- how a catalog adds kinds
```
`info.collider` is the kind's one collider (`capsule` radius/height/offset, `sphere`, `box` size/offset, or `mesh` with `meshes[variant]`). Palms also carry `info.trunks[variant] = { { x0, y0, z0, x1, y1, z1, r }, ... }`: capsule segments (local metres) following that variant's baked trunk or trunks, which `TropicalProp` builds as a capsule chain.
## pierLayout
`require("tropicalProps.ShoreCatalog").pierLayout(length, opts?) -> { { kind, position = {x,y,z}, yaw, variant } }` lays a whole pier along +Z from the origin (deck top y = 0): steps, 2 m deck sections (some broken), posts, railings, lanterns, the end platform with a hut, ladder and a moored boat. Options: `railings` (`both` | `left` | `right` | `none`), `steps`, `endPlatform`, `hut`, `lanterns`, `ladder`, `boat`, `sign`, `broken` (chance per section, default 0.15), `seed`, `deckHeight`, `waterY`.
```luau
local SC = require("tropicalProps.ShoreCatalog")
local pier = entity.spawn("pier", { position = { 0, 1.2, 20 } })
for _, p in SC.pierLayout(24, { railings = "both" }) do
local e = entity.spawn(p.kind, { parent = pier, position = p.position, rotation = { 0, math.sin(p.yaw / 2), 0, math.cos(p.yaw / 2) } })
e.component.add("tropicalProps.TropicalProp", { kind = p.kind, variant = p.variant })
end
```
## Budgets (triangles, worst variant)
| | LOD0 | LOD1 | LOD2 |
|---|---|---|---|
| coconut palms (real) | 10.2-11.8k | 2.3-2.6k | <= 380 |
| fan palm / young / pandanus | 9.0k / 3.1k / 2.5k | 2.6k / 0.9k / 0.9k | <= 430 |
| palm cluster (3-4 trunks) | 14.0k | 4.7k | 1.0k |
| palms, toon / lowpoly | 0.4-4.3k / 0.15-1.4k | | |
| bushes | 1.6-2.2k | <= 600 | <= 72 |
| small plants, litter | 0.1-1.9k | <= 400 | culled |
| rocks | 1.3-3.3k | 0.3-0.8k | <= 400 |
| cliffs | 4.6-7k | 1.2-2k | <= 280 |
| coral | 1.7-5.9k | 0.3-1.6k | <= 620 |
| pier pieces | 0.25-3.7k (lookout 6.2k) | 0.1-1.4k | <= 500 |
300 palms with automatic detail cost about 0.8 ms of script time a frame (one LOD test per prop every 6 frames).
## Mesh contract
Real-world metres, +Y up, origin at the ground contact (pier pieces: deck top). Leaning and bent palms lean toward +Z. Vertex colour RGB is a tint the material multiplies its albedo by; vertex alpha is the wind-sway weight on foliage (0 at the base, 1 at the tips) and 1 on solid parts (trunks, stems, nuts, rock, wood). Front faces are counter-clockwise and agree with the normals. Every part of a prop shares one bounding box, so all parts swap LOD together.
Textures and UVs: leaves, leaflets, fan segments, petals and bracts are real geometric outlines, each carrying UV 0..1 (u across, midrib at u = 0.5; v = 0 at the base, 1 at the tip), so a tropicalMaterials leaf card (one leaf per 0..1 square, two-sided) reads on them; grass is alpha tuft cards (v = 0 at the ground); bark wraps u twice around a trunk with v = metres up it; leaf-material stalks sample the opaque midrib strip of the leaf texture. No texture is shipped here: every surface comes from `tropicalMaterials.TropicalMaterials.get(surface, { look })`.
## Regenerating
Meshes are generated once and baked into the package (`meshes/veg/<kind>/`, `meshes/shore/<kind>/`), read through generated literal indexes (`BakedVeg`, `BakedShore`), so installing costs no generation. The bakers write into the package's own folder, wherever it is installed.
- Vegetation: edit `VegPalms` / `VegPlants` (kit `VegGeo`, catalog `VegetationCatalog`), then in a task `require("tropicalProps.VegBake").run()` (all, a few minutes) or `.run({ kinds = { "palmFan" }, forms = { "toon" } })`; `.report()` answers the triangle table. Mesh names: `<kind>_<form>_v<n>_l<lod>_<part>`, forms `real`, `toon`, `low`.
- Shore: edit `ShoreRocks` / `ShoreSea` / `ShorePier` (kit `ShoreGeo`, table `ShoreGen`), then `require("tropicalProps.ShoreBake").run()` or `.run({ kinds = { "cliffWall" } })`.
- New `.mesh` folders are committed with the rest of the package (`zm add` the package folder).
Tests: `zero tests run tropicalProps` (edit mode) checks every kind x look x variant x LOD, colliders and trunk chains, `pierLayout` and `TropicalProp` rebuilds.
# ShoreCatalog
Registers the shore half of tropicalProps with `Props`: 41 kinds of rocks, cliffs, coral, sea grass, shore litter and a modular weathered wooden pier, each in 2-3 seeded variants, LOD0/1/2 and all five looks (real, painted and pixel share the default geometry; toon draws a chunkier smoother bake; lowpoly a coarse flat-shaded bake). Meshes come only from `BakedShore` (literal resolves), materials only from `tropicalMaterials.TropicalMaterials.get(surface, { look })`.
```luau
local Props = require("tropicalProps.Props")
Props.parts("cliffWall", { look = "toon", variant = 2, lod = 0 }) -- { { mesh, material }, ... }
entity.spawn("rock").component.add("tropicalProps.TropicalProp", { kind = "rockBasalt", seed = 17 })
```
| Category | Kinds |
|---|---|
| rock (mesh collider, surface `rock`) | `rockBeach`, `rockBasalt`, `rockLimestone`, `rockMossy`, `rockCluster`, `rockShelfTidePool` (surface `wetRock`, walkable, pools of `tidePoolWater` with urchins / anemones / a red starfish), `pebbleScatter` (no collider) |
| cliff (mesh collider) | `cliffWall` (12 m wide, 11-19 m tall, faces +Z out to sea, tiles along X: every variant shares the edge profile at x = +-6, runs 2 m below y = 0), `cliffSpire` (sea stack 8.5-14.5 m), `cliffBoulderPile` |
| coral / seagrass (`underwater = true`) | `coralBrain`, `coralStaghorn`, `coralTable` (mesh collider), `coralFinger`, `coralPink`, `seaFan` (card), `coralCluster`, `seaGrass` (cards), `kelpClump` (cards) |
| litter | `driftwoodLog` (mesh collider, `wood`), `driftwoodBranch`, `shellConch`, `shellCowrie`, `shellScallop`, `shellScatter`, `starfish` (v1-2 orange, v3 red), `seaweedStrand`, `seaweedLine` |
| pier (surface `wood`) | `pierDeck`, `pierDeckBroken`, `pierPost`, `pierRailing`, `pierLadder`, `pierSteps`, `pierEnd`, `pierHut`, `bollard`, `lantern`, `rowboat`, `signpost`, `lookoutDeck` |
Pier grid: pieces snap every 2 m along +Z; deck top is y = 0 at the origin; a deck section spans x -1.2..1.2, z 0..2 (posts at x = +-1.3 at each section start); the end platform x -2..2, z 0..4 (posts at x = +-2.1); a railing runs z 0..2 at its own x = 0; steps go down toward -Z from z = 0 to 1.4 m below; the ladder hangs over an edge facing +Z; the hut and the lookout deck (top at y = 0.4, open toward +Z) are centred on their origin.
## pierLayout
`ShoreCatalog.pierLayout(length, opts?) -> { { kind, position = {x,y,z}, yaw, variant } }`: a whole pier along +Z from the origin in local metres, yaw in radians about +Y, so one parent transform places it. Options: `railings` ("both" | "left" | "right" | "none"), `steps`, `endPlatform`, `hut`, `lanterns`, `ladder`, `boat` (default true), `sign` (default false), `broken` (chance per deck section, default 0.15), `seed`, `deckHeight` (added to y), `waterY` (boat waterline relative to the deck, default -1.1).
Hooks: `ShoreCatalog.LIGHTS.lantern` = `{ offset, color, range, intensity }` (a point light for the lantern glass at night); `ShoreCatalog.SIGN_FACE` = the signpost board's face centre / size / normal for a Text3D label.
## Budgets (triangles, variant 1, default form)
Rocks LOD0 1.3-3.3k, LOD1 0.3-0.8k, LOD2 <= 400; tide-pool shelf 7.2k / 1.9k / 0.3k; cliffs 4.6-7k / 1.2-2k / <= 280; coral 1.7-5.9k / 0.3-1.6k / <= 620; cards (fans, grass, kelp, wrack) <= 500; shells and starfish <= 2k / 650 / 200; pier pieces 0.25-3.7k / 0.1-1.4k / <= 500 (lookout deck 6.2k). Lowpoly bakes LOD0 only (the LOD2-class shape, flat-shaded); toon bakes LOD0/1. Exact counts per part are in `BakedShore.kinds`.
## Regenerating
Generators: `ShoreRocks`, `ShoreSea`, `ShorePier` (kit: `ShoreGeo`; table: `ShoreGen`). After a change, in a task: `require("tropicalProps.ShoreBake").run()` (all kinds, ~30 s) or `.run({ kinds = { "cliffWall" } })`. It overwrites meshes under `meshes/shore/<kind>/`, prunes stale ones and rewrites `BakedShore`. New `.mesh` folders are committed file by file: `zm add tropicalProps.package/meshes/shore/*/*.mesh`.
# ShoreGen
The table of every shore kind's generator (from `ShoreRocks`, `ShoreSea`, `ShorePier`) and `ShoreGen.build(kind, variant, lod, form)`, which seeds the generator per kind + variant (so LODs and looks are one shape) and flat-shades the lowpoly form. `FORM_LODS` says which LODs each form bakes. Bake-time only; `ShoreBake` calls it.
# ShoreGeo
Bake-time geometry kit for tropicalProps' shore generators (`ShoreRocks`, `ShoreSea`, `ShorePier`): seeded random (`rng`), `fbm`, bent cards (`strip`, `arcSpine`), swept tubes (`tube`, `rod`), geodesic blobs (`blob`), exact convex polytopes (`polytope`, `facetMesh`), skins grown over a solid (`skin`), flat shading for the lowpoly look (`flat`), chamfered timber boards (`board`), discs, grids, toruses and `toMesh`. Based on alpineProps' GroundKit and forestProps' GroundGeo (MIT). Nothing on the gameplay path requires it.
# BakedShore
GENERATED by `ShoreBake.run()`: the bake manifest of the shore kinds (variants, forms, LODs, parts and triangle counts) and `mesh[name]()`, one literal `asset.resolve` per baked mesh. `ShoreCatalog` reads meshes only through it. Do not edit by hand.
# TropicalMaterials
The resolver of the tropicalMaterials package: `TM.get(surface, { look })` answers a material for any of the 50 Turquoise Cay surfaces (powder-white coral sand, pink coral sand, black volcanic sand, wet sand, rippled sand, coastal grass, jungle soil, cliff and tidal rock, coral rubble, rock props, palm leaflets, fan palm, beach grass, sea grape, hibiscus, bougainvillea, morning glory, banana leaf, spider lily, palm bark, coconuts, driftwood, shells, starfish, seaweed, kelp, corals, sea fans, sea grass, urchins, anemones, tide-pool water, pier planks and posts, rope, rusty iron, thatch) in five looks (real, painted, toon, lowpoly, pixel), never nil. Also `TM.surfaces()`, `TM.group()`, `TM.isCard()`, `TM.palette()`, `TM.source()` (where an answer came from), `TM.terrainLayers()` (the ten ground surfaces that are terrain layers) and `TM.terrainLayer(name, look)`, the record the engine terrain's `surfaces` input takes. Props, tropicalKit and terrain painting call it; `look` nil or "auto" follows TropicalLook.
# tropicalMaterials: Turquoise Cay tropical surfaces
**Every surface of a Caribbean-style tropical island behind one name, in five looks (real, painted, toon, lowpoly, pixel): 50 named surfaces, 39 of them shipped as the package's own generated materials, the rest borrowed from installed collections.** Three kinds of beach sand are among them: powder-white coral sand, pink coral sand (Bermuda, Harbour Island) and glossy black volcanic sand (Punalu'u). `TropicalMaterials.get("palmFrond", { look = "toon" })` returns a material you put straight on a `Model` or an instanced draw, and `TropicalMaterials.terrainLayer("sandPink")` returns a layer record for the engine terrain.
**Install and use:** install tropicalMaterials from ZeroMind. It brings Terra Firma, Bedrock, Heartwood, Scale and Feather and the materialLibraryKit core with it. Then `require("tropicalMaterials.TropicalMaterials")` and ask for a surface by name and look, as in the first example. A `TropicalLookSetting` component switches every surface between the looks for every player at once. The package works wherever it is installed (a world's own folder, a dependency of tropicalKit or tropicalProps, a library): nothing in it, its tests and its authoring tools included, looks for a fixed path.
**Guides:** "How do I use tropical sand, coral and palm materials?" (getting a surface, the five looks, switching every look with one change, terrain layers, the full surface list) and "Make a beach terrain with dry, wet, pink and black sand" (an empty world to a baked four-sand beach with swatches). Both ship in `guides/`; `man` or the Docs panel opens them.
## First example
Runs as written in an empty world that installed only tropicalMaterials:
```luau
local TM = require("tropicalMaterials.TropicalMaterials")
local sand = entity.spawn("sandPatch", { temporary = true, components = { Model = {
model = "@builtin::meshes.plane",
material = TM.get("sandDry"), -- powder-white coral sand (real look)
} } })
sand.localScale = { 4, 1, 4 }
local pink = entity.spawn("pinkSandPatch", { temporary = true, components = { Model = {
model = "@builtin::meshes.plane",
material = TM.get("sandPink"), -- pink coral sand with red flecks
} } })
pink.localPosition = { 4, 0, 0 }
pink.localScale = { 4, 1, 4 }
local black = entity.spawn("blackSandBall", { temporary = true, components = { Model = {
model = "@builtin::meshes.sphere",
material = TM.get("sandBlack", { look = "painted" }), -- black volcanic sand, hand painted
} } })
black.localPosition = { 8, 0.5, 0 }
local leaf = entity.spawn("palmLeaflet", { temporary = true, components = { Model = {
model = "@builtin::meshes.plane",
material = TM.get("palmFrond", { look = "toon" }), -- the same leaflet, cel shaded
} } })
leaf.localPosition = { 0, 0.6, 0 }
leaf.localRotation = { 90, 0, 0 }
leaf.localScale = { 0.15, 1, 0.6 }
print(TM.source("sandDry")) -- own:sandDry
print(TM.source("driftwood")) -- installed:woodsMaterials.materials.driftwood
print(TM.source("hibiscus", { look = "pixel" })) -- runtime:tropicalMaterials:hibiscus|pixel
print(TM.terrainLayer("sandWet").albedo) -- tropicalMaterials.textures.sandWet_albedo
print(TM.terrainLayer("sandBlack", "toon").albedo) -- tropicalMaterials.textures.terrain_sandBlack_toon_albedo
```
## API
- `TM.get(surface, { look? }) -> material`, never nil. `look` is `real | painted | toon | lowpoly | pixel`. nil or `"auto"` follows `TropicalLook.get()`, an unknown look is `real`, and an unknown surface returns a neutral driftwood.
- `TM.surfaces() -> { string }`: the 50 names in catalogue order. `TM.group(surface)` -> `ground | rock | leaf | flower | bark | fruit | shore | shell | sea | coral | water | pier`. `TM.isCard(surface)` -> whether it is an alpha-cut two-sided card. `TM.palette(surface)` -> its flat lowpoly colour (linear).
- `TM.source(surface, opts)` says where the answer came from (`own:`, `installed:`, `runtime:`, `fallback:`). `TM.refresh()` drops the cache.
- `TM.terrainLayers()` -> `sandDry, sandWet, sandRippled, sandPink, sandBlack, grassCoastal, soilJungle, rockCliff, rockWet, coralRubble` (a terrain carries at most eight of them). `TM.terrainLayer(name, look?) -> { name, albedo, normal?, mask?, tiling, tint }`: texture identities and metres per repeat, exactly the record `terrain.write`'s `surfaces` input takes (see the terrain guide, "Surfaces: the layer table"). The mask uses the terrain layout (R metallic, G AO, B height, A smoothness). Wet sand's and wet rock's masks are glossy (high smoothness); black sand's is semi-glossy with glinting grains.
- `TropicalLook` (module): `set`, `get`, `resolve`, `valid`, `onChanged`, `LOOKS`. `TropicalLookSetting` (component): a synced `look` field that calls `TropicalLook.set` on every peer.
Every asset TM returns or builds from is resolved from a string literal in the generated `TropicalMaterialsTable`, so the props and scenes that call it stay publishable.
## Every surface
Own = a material this package ships, made from generated textures (`materials/`, `textures/`). Installed = a collection material used as installed. Runtime = built once per machine from shipped textures, adding no texture memory. Every surface also has painted, toon, lowpoly and pixel looks, built at runtime from the same textures.
| Surface | Looks like | Comes from |
|---|---|---|
| **Ground** (2.5 m tiles; all ten are terrain layers) | | |
| `sandDry` | powder-white coral sand with visible grain, fine dark grit and shell specks (no channel above 238) | own, 1024² tile + terrain mask |
| `sandWet` | swash-wet beige-grey sand, glossy film | own, 1024² tile + glossy terrain mask |
| `sandRippled` | pale sand in soft wave ripples | own, 1024² tile + terrain mask |
| `sandPink` | pink coral sand as on Bermuda and Harbour Island: pale pink-white grains, red foraminifera flecks, a few white shell bits, dry and matte | own, 512² albedo, 256² normal and rm, 128² terrain mask |
| `sandBlack` | black volcanic sand as at Punalu'u: glossy black-grey basalt grains, glassy specks that glint (low-roughness grains, light clear coat) | own, 512² albedo, normal and rm, 128² semi-glossy terrain mask |
| `grassCoastal` | short salt-tolerant grass over sand | own, 1024² tile + terrain mask |
| `soilJungle` | dark leaf-litter jungle floor | installed: Terra Firma `forestFloor` |
| `rockCliff` | warm grey-brown cliff rock | installed: Bedrock `cliffRock` |
| `rockWet` | dark glossy wet tidal basalt, pitted and cracked, white barnacle clusters, emerald algae in the hollows | own, 512² tile + glossy terrain mask (smoothness about 0.75) |
| `coralRubble` | bleached broken coral fragments | own, 1024² tile + terrain mask |
| **Rock props** | | |
| `rockBasalt` | dark grey volcanic basalt | installed: Bedrock `basalt` |
| `rockLimestone` | pale porous limestone | installed: Bedrock `limestone` |
| `rockMossy` | stone with green moss | installed: Bedrock `mossyStone` |
| `pebbles` | rounded mixed pebbles | installed: Bedrock `riverPebbles` |
| **Leaves and flowers** (cards) | | |
| `palmFrond` | deep emerald coconut-palm leaflet, yellow-green toward the tip, darker underside | own card |
| `palmFrondDry` | dead straw-brown leaflet | own card |
| `fanPalmLeaf` | deep green fan-palm segment | own card |
| `beachGrass` | fresh green dune-grass tuft, a little straw only at the blade tips | own card |
| `seaGrapeLeaf` | round leathery sea-grape leaf, mid green | own card |
| `tropicalLeaf` | broad banana-style leaf, deep green | own card |
| `hibiscus` | red hibiscus petal | own card |
| `bougainvillea` | magenta bougainvillea bract | own card |
| `morningGlory` | violet morning-glory petal | own card |
| `spiderLily` | white spider-lily petal | own card |
| **Palm wood and fruit** | | |
| `palmBark` | ringed grey-brown coconut palm trunk | own tile |
| `palmBarkYoung` | greener, smoother young trunk | own tile |
| `coconutHusk` | brown fibrous ripe husk | own tile |
| `coconutGreen` | smooth, slightly glossy lime-green young coconut rind with fine streaks | own, 256² tile |
| **Shore and shells** | | |
| `driftwood` | sun-bleached silver driftwood | installed: Heartwood `driftwood` |
| `shellConch` | cream and blush-pink conch, spiral ridges, glossy porcelain lip | own, 256² tile, clear-coated |
| `shellCowrie` | porcelain-glossy tiger cowrie, cream-tan with dark brown spots | own, 256² tile, clear-coated |
| `shellScallop` | ribbed scallop shell | installed: Scale and Feather `shell` |
| `starfish` | orange cushion starfish | own tile |
| `starfishRed` | the starfish in red | runtime (starfish textures, tinted) |
| `seaweed` | olive tide-line wrack | own card |
| `kelpBrown` | brown kelp blade | own card |
| **Reef** | | |
| `coralBrain` | tan brain coral with meandering grooves | own tile |
| `coralStaghorn` | cream-tan staghorn branches | own tile |
| `coralTable` | sage and tan table coral, dense polyp cups | own, 512² tile |
| `coralPink` | coral-pink porous coral with paler polyp cups | own, 512² tile |
| `seaFan` | purple sea fan | own card |
| `seaGrass` | green sea-grass blades | own card |
| `urchin` | black long-spined urchin, glossy dark-purple spines | own, 256² tile |
| `anemone` | mauve sea anemone with pink-magenta tentacle tips | own, 256² tile, sheen |
| `tidePoolWater` | clear tide-pool water: depth tint, ripples, Fresnel sky, sun glint | runtime (`tropicalWater`) |
| **Pier** | | |
| `pierPlank` | weathered grey deck planks | installed: Heartwood `weatheredPlanks` |
| `pierPost` | weathered silver-grey post wood; green algae and dense barnacles from the foot up to about 2 m, dry above | own, 256×1024 strip (u around, v up) |
| `rope` | tan twisted rope | own tile |
| `ironRusty` | rusty iron fittings | own tile |
| `thatch` | dry palm thatch | own tile |
## UV conventions the materials are made for
- **Leaves, leaflets and petals** (palmFrond, palmFrondDry, fanPalmLeaf, seaGrapeLeaf, tropicalLeaf, hibiscus, bougainvillea, morningGlory, spiderLily, kelpBrown): ONE leaf or petal fills the 0..1 square, u across its width (midrib at u = 0.5), v = 0 at the base / stalk and v = 1 at the tip. **Tufts** (beachGrass, seaGrass, seaweed, seaFan): one clump card, v = 0 at the ground.
- **Bark** (palmBark, palmBarkYoung): u once round the trunk, v in metres up it. Rings run along u.
- **Pier post** (pierPost): u once round the post, v in metres up from its foot. The strip spans 4 m: barnacles and algae up to about 2 m, a ragged algae line, then dry grey wood. It clamps past the top, so a taller post stays dry wood.
- **Vertex colour**: RGB tints the albedo. On cards, ALPHA is the wind weight (0 rigid base, 1 full sway). Solid surfaces ignore vertex alpha.
- **Tiles**: ground surfaces repeat every 2-2.5 m of uv when `uv` is in metres. Props use 1 uv unit ≈ 1 m, and the small-prop tiles repeat faster: conch 4×, cowrie and coconut 1.5×, urchin and anemone 2×, table coral 1×, pink coral 1.5×.
## Looks
- **real**: tiles on `tropicalSolid` (opaque PBR, wetness film, clear coat, sheen, optional bottom-up tint band in world height). Cards on `tropicalFoliage`: alpha cut 0.45, two-sided, darker underside, light through the leaf from the sun or a lamp behind it, and sky light only through the face turned away from the sky. Engine wind sways them by vertex alpha, plus flutter. Tide-pool water on `tropicalWater` (clear by depth, ripples, Fresnel sky, sun glint).
- **painted / toon / lowpoly / pixel**: built at runtime on `tropicalStylised` from the same textures, for every surface.
- Painted: soft brush patches in stepped tones, wrapped light, cool shadows.
- Toon: hard tones, two light bands, pale rim, hard gloss spot on wet things.
- Lowpoly: per-face normals (from derivatives), one palette colour per surface with a slight facet jitter.
- Pixel: about 24 texels a metre (12 across a leaf), mip-averaged blocks, brightness posterised with hue kept, hard light bands.
- Leaves keep their natural saturation in toon and painted.
- **terrain**: the engine terrain shades its layers itself, so each terrain layer has a baked albedo per stylised look (`terrain_<layer>_<look>_albedo`: painted 256², toon 128² flat pale tones, lowpoly 64² palette, pixel 256² of 4x4 blocks), and `terrainLayer(name, look)` hands those out.
## Texture memory
151 textures, **47.8 MB** of GPU memory (UASTC/BC7, 1 byte a texel, mipmaps included), inside the 48 MB web budget the tests hold it to.
- The five 1024² ground tiles (albedo, normal, rm and terrain mask) are 28 MB of that.
- The two newer sands are kept small to stay in budget: pink sand 512² albedo with 256² normal and rm, black sand 512² albedo, normal and rm (its glints need the resolution), both with 128² terrain masks (about 1.6 MB together).
- Prop tiles are 512² (rockWet, corals, bark, coconut husk, rope, iron, thatch, starfish), 256² for small props (shells, green coconut, urchin, anemone), and 256×1024 for the pier-post strip.
- Cards are 64-512 px, and the baked terrain looks are 2.4 MB.
`TropicalMaterialsBuild.textureMemory()` recounts it.
## What's in the package
- `TropicalMaterials.module` the resolver; `TropicalMaterialsTable.module` its generated literal table; `TropicalLook.module` the look switch; `TropicalLookSetting.component` the synced switch.
- `shaders/`: `tropicalSolid`, `tropicalFoliage`, `tropicalStylised`, `tropicalWater`.
- `materials/` (39), `textures/` (151), `tropical.materialCollection` (the 39 in materialLibraryKit's picker).
- `guides/`: the how-to (surfaces, looks, terrain layers, the full list) and the four-sand beach walkthrough.
- Authoring:
- `CardBaker.module`: keys a leaf painted on a flat key colour into a fitted, halo-free cut-out with a normal map, base flipped to v = 0. `regrade` grades a card to a target colour.
- `TropicalMaterialsBuild.module`: `importTile` (with roughness remap, glint, height and per-map shrink options), `regradeTile`, `writeMaterials`, `writeTable`, `writeCollection`, `bakeTerrainLooks`, `swatches`, `textureMemory`. Build order: textures, then materials, then the table. Both modules find the package's folder from their own location, so they run wherever the package is installed.
- `tests/tropicalMaterials.testSuite`.
## Depends on
Installed packages, at the versions `package.yaml` states: materialLibraryKit 1.4.3, Terra Firma (groundMaterials) 1.0.8, Heartwood (woodsMaterials) 1.0.1, Bedrock (stoneMaterials) 1.2.1, Scale and Feather (organicMaterials) 1.0.7.