MATERIA
MATERIA (Latin materia, "matter, stuff", and also the timber a thing is built from) is the one way every TROY app asks what a thing is made of. It is not an app. It is a small contract and a library behind it, written in GLSL: give it a kind of material and a point in space, in millimetres, and it says what is there — its colour, how shiny it is, whether it is metal, how much light gets through, and how far the surface stands proud. METOPE, SPOLIA, LAPIDEO's ROMA lab and POLYCHROMIA all ask it the same way, so a Carrara in one is the same Carrara in all of them.
Settled on 2026-11-10, when Auriea said "I do want all of these apps to use the same paradigm." State on 2026-11-19. The last section says what is not there yet.
The question
Every app asks one thing:
Mat matAt(float kind, vec3 pMm)
- The material is a field in the solid, in millimetres. There are no UVs, so there are no seams. Carve it, bake it, cut a tessera from it, and the figure is in the body of the stone.
- A material is a recipe, not a setting. No seeds and no sliders. "Another block" is another place: the app moves the point.
- One evaluation answers everything. The answer has five values: the albedo (linear colour), the roughness, the metal (0 or 1: gold, bronze and leaf are 1, stone is 0), the trans (how much light passes through, from 0 to 1: clear glass is 1, alabaster .45, shell .3, stone 0) and the relief in millimetres (+ stands proud, − lies lower; hundredths of a millimetre on a polished stone, the trace polishing leaves between hard and soft minerals; wear and paint change it, and a baker turns it into the normal map).
- The app says how finely to look. It sets the millimetres per sample (a pixel on screen, a texel in a bake) before it asks, and nothing in a material reads the screen. Fine tooth fades out as the sample gets coarser instead of shimmering.
- The same stone on every GPU. Hashes are integer hashes (a
sin()hash drifts between devices), and the code needs WebGL 2.
Skins
What lies on a surface is a second stage, a skin:
Mat skin(Mat m, vec3 pMm, Surf s, float amt)
The material underneath comes in as m, and amt, from 0 to 1, says how much of the skin is there, so a mask can drive it. Surf tells the skin about the form at that point: its normal, the direction a stroke runs (the brush, the drip), how many millimetres to the nearest edge and to the nearest crease, how shut in the spot is, and how open to what falls from above (dust, rain). So paint can follow a surface, and wear can find an arris. A skin never moves the point, and it may only add its effects of form as an edge or crease comes near: an app that cannot supply a value passes the neutral one, so nothing invents an edge or a shadow that is not there. This is how POLYCHROMIA's Skin layers work, each taking what lies below it and laying something on.
The table of kinds
One table for every app, and a number is never reused, because saved work stores it.
| kinds | what |
|---|---|
| 0 | Plain, the unassigned clay |
| 1–7, 13–21 | the stones METOPE and SPOLIA shared first (Carrara, Bardiglio, Nero, Portoro…) |
| 8–12 | hardwoods |
| 22–48 | SPOLIA's other substances: plaster, metals, earth, ceramic, glass, bone, shell, linen, velvet, blood |
| 49–60 | free |
| 61–69 | ROMA, nine stones after the churches of Rome: porfido rosso, serpentino, giallo antico, pavonazzetto, bianco, africano, breccia dorata and two alabasters |
| 70–85 | from LAPIDEO's presets: Calacatta oro, Verde Guatemala, Statuario, dendrite, ammonite, fasciated amber, and six woods (teak, Douglas fir, mahogany, wenge, zebrawood, macassar ebony) |
| 86–88 | malachite, turquoise (2026-11-10) and cast iron (2026-11-13), each asked for by Auriea |
| 89–999 | free |
| 1000 and up | local: a material made inside one app and carried by the saved piece that uses it |
A local number means something only inside its own piece, and two pieces may both have a 1000. The piece stores a name, the GLSL and the version of the core it was written against. If one fails to build on a device, the app shows a plain grey stand-in and says so, and the piece and its stored source stay as they were. A local material that proves itself can be given a number below 1000 and move into the shared table.
The set
The table holds 71 entries in nine families: Roma (9), Marbles (12), Breccias (9), Hard stones (3), Stones (7), Woods (11), Metals (8: gold, gilt bronze, bronze, copper, silver, lead, iron, cast iron), Earth and fire (6) and Soft and living (6, with Plain). Each has a note from where it comes from, e.g. Giallo antico — Chemtou, Numidia · gold limestone healed in red-violet.
What "the ROMA way" means, as the nine stones set it and the rest follow:
- Crystals are crystals: rotated boxes cut by the face, so porphyry shows laths, rhombs and hexagons, not round dots.
- Breccias have a size hierarchy. Big clasts come first and smaller ones fill only what is left, so no two fragments overlap and the crush fills the gaps. Every clast carries its own figure and a rim.
- Veins are fracture sets that come and go along their length, not worms. Beds are of unequal width with one hard edge and one soft.
- A field a few hundred millimetres across decides which block this is, so two tesserae cut far apart are two different stones.
- Everything gives relief: a travertine's holes are holes, a weave has crowns, hammered metal has facets.
- Wood, shell and linen need a direction and a solid has none to be told, so wood grows along x in logs about 640 mm across, and linen is woven layers lying in the solid's xy plane.
The core also holds the tools every material is built from: integer hashes, noise, cells, crystals, veins, fracture sets, the grain of a sawn face, a dragged brush and the breccia clasts.
How the apps carry it
METOPE, SPOLIA and POLYCHROMIA are each one file that works offline, so none can load the shared material files when it runs. Each carries a generated copy, written between MATERIA: markers by its own sync script (_sync-metope.cjs, _sync-spolia.cjs, and _sync-materia.cjs in POLYCHROMIA's folder), all fed by one generator. The copy is never edited by hand. A material is changed in LAPIDEO, looked at in the ROMA lab, and then the scripts are run (each has a --check that says whether its app is up to date).
Each kind is one line in a chain of the exact form if(kind<N.5){ return mkN(p); }, so an app can switch off every kind a piece does not use, the browser's compiler drops the code, and what runs is one small program per material.
- LAPIDEO holds the definition files and the ROMA lab (
roma.html): a ball of every kind to look at and judge. - SPOLIA is on the whole table, under the kind numbers it already stored (live 2026-11-11).
- METOPE is on it too (live 2026-11-11), and asks for a material's colour and roughness only for now.
- POLYCHROMIA uses all five values, and draws every material in its Library as a 120 mm ball made by that kind's own code, at true size (first version 2026-11-11, live 2026-11-12).
MATERIA_VERSION is 2. It goes up by one whenever the shape of the contract changes or a function that exists changes what it returns; adding a function does not count. Version 1 (2026-11-10) added the relief value and skins; version 2 (the same day) added Surf for skins and the local kinds.
Where it lives
In TROY/LAPIDEO/lapideo/: materia-core.js (the contract, the shared tools, the table of kinds), roma-stones.js (kinds 61–69), roma-substances.js (every other kind, with romaKind(kind, pMm), which answers for the whole table), roma.html (the lab) and the generator and sync scripts. The files are plain .js, never .mjs, because the server sends .mjs as text. Related: LAPIDEO-Research, the research behind the marbles and woods.
Not there yet
- METOPE does not yet use a material's metal, light-through or relief.
- Local materials (1000 and up) are written into the contract, but no app makes or carries one yet (checked 2026-11-19).