Skip to content

Material library: named materials that read on any page, with fibre surfaces - #63

Merged
ProjectIdris merged 6 commits into
mainfrom
materials
Nov 8, 2026
Merged

ProjectIdris merged 6 commits into
mainfrom
materials

Conversation

@ProjectIdris

Copy link
Copy Markdown
Owner

Summary

A material library: the model names what a part is made of, and the part reads on light and dark pages.

  • One table, 19 materials (src/scene/material-library.ts): plastic, metal, rubber, pcb, glass, glow, paper and tissue as before, plus bone, muscle, tendon, skin, steel, iron, brass, copper, wood, rope and water. The schema enum, default colours, the guide's list and treatments all read from it.
  • Tints stay readable: a banded material takes a tint's hue but keeps its own band of lightness, so bone tinted white is the palest bone, never white. Bands were set from rendered swatches: the lit body stays at 1.8 to 1 or better on a white page and 2.6 to 1 or better on a dark one. Bone was 1.35 before and vanished on white.
  • Fibre surface treatment (37e7def, kept whole and merged): path-following coordinates and two filtered shader waves change colour and roughness on the existing mesh, with no new geometry. They are drawn on muscle, tendon and rope.
  • Connectors that name a material take its colour; a plain connector stays the grey cord.
  • Guide: a group has only its origin and the points named with anchor.

Validation

  • 8 live answers on Sonnet across the judge set (arm, door, engine, bicycle, heart, pulley, plus a wheel and a dark-page arm). The model names bone, muscle, steel, iron, wood, rope, water and brass without an example and tints rarely. Bones no longer vanish on a white page.
  • One arm answer lost its forearm to the group-point gap. After the guide fix, the same question on the light page kept every part.
  • Engine, bicycle and heart are as before.
  • Focused tests pass (117), including the fibre treatment's own; typecheck clean. Each new test was seen failing first.
  • Probes:
    • all 19 materials with five colour cases validate cleanly;
    • over 2,376 tints, the tint fit never leaves its band, never produces NaN and is idempotent;
    • the lean schema is 26.8 KB, under its cap.
  • No shipped sample changes look.
  • Independent review by a second reviewer, not the author, of the whole branch, including the fibre code: no blocking findings.

Review limits

  • Untinted plastic and rubber are now mid-tone, and a part with no material and no colour takes the plastic default, so a live answer that omits colour looks darker than before.
  • Glass stays faint on a white page.
  • At today's stage size the fibres are a few pixels.
  • The fibre layer adds about 0.27 ms a frame (about 12%) on the software tier; its GPU cost is not measured.

🤖 Generated with Claude Code

ProjectIdris and others added 6 commits November 8, 2026 14:06
…s, copper, wood, rope and water, whose tint keeps to the material's own lightness so they read on a light page and a dark one

One table (scene/material-library.ts) makes the schema's material enum, each material's default colour and the guide's list. A material may carry a band of lightness: a tint gives it a hue but is drawn toward the material's own colour until it is inside the band, so a bone tinted white is the palest bone, never white on a white page. The band numbers were set from rendered frames of each material on a near-white and a near-dark page (lit body at least 1.8 to 1 against the light page and 2.6 to 1 against the dark one). Plastic and rubber keep no band (a colour the scene writes is as written) but their default colour is now a mid-tone, so an untinted one reads on both pages. Recipes (roughness, metalness, sheen, clearcoat) are in the renderer, typed over the same names; SURFACE_LAYERS is where a surface layer plugs in by name from a recipe's layers, empty until one is registered.

Tests: scene-materials (library, band, renderer, layer registry, validation), each seen failing with its code switched off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The fibre layer is wired under the named materials: a muscle, tendon or rope tube or connector wears it without the scene asking (the library row carries the treatment), and treatment still asks for it on any other material. Her commit is kept whole; the reconciliation is the merge and the wiring (treatmentOf in surface-treatment.ts, the library's treatment, the guide and doc lines).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…anchor, since a model attached a forearm to the bottom of a group and lost it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… plain grey cord

The arm re-run showed a muscle connector drawn grey: a connector's default colour was chosen before its material was looked at. A connector with no material is still the grey cord.

Tests: a muscle and a rope connector take their library colours (seen failing first), and a plain one stays grey.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…which now imports it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ProjectIdris
ProjectIdris merged commit 21cd3c7 into main Nov 8, 2026
4 checks passed
@ProjectIdris ProjectIdris mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant