Skip to content

raea/wear: a recipe per material class (WR5) - #198

Merged
shinyobjectz merged 1 commit into
mainfrom
wear-recipes
Nov 19, 2026
Merged

shinyobjectz merged 1 commit into
mainfrom
wear-recipes

Conversation

@shinyobjectz

Copy link
Copy Markdown
Owner

docs/wear.feature WR5, for 0.1.8.

  • sdk/wear (raea/wear): wearBake (the native call, now typed in native-calls.ts) and wearShader({ baked, classes?, age, weather, up?, debug? }), which returns { wesl, uniforms, textures } for a <ShaderExtension>, <MeshStandardMaterial shader> or <SurfaceShader>.
    • It has one WESL function per class (14), the stains, rising damp and splash they share, and WR9's season and weather over them.
    • Age (years, soot, upkeep) and weather (day, wet, snow, storm, ice; the season's damp, dust and leaves follow from the day) are uniforms.
    • A debug mode draws any of 14 causes in false colour from a lit hook.
    • A mesh without the bake's second UV set is left as it was.
  • raea-sys-weathering 6:
    • causes2's spare alpha now carries the texel's class, which the shader reads with textureLoad, so one shader serves every material.
    • The gutters copy class and element instead of averaging them.
    • A primitive with no UV set gets the atlas's UVs as TEXCOORD_0 too. Bevy's standard surface reads the first set wherever there's a second, so without this the shader didn't compile.
  • The 0.1.8 What's new page gets a line under For builders.

Proof:

  • bun test in sdk/wear: 12 pass.
  • cargo test -p raea-sys-weathering: 11 pass, one of them new.
  • Gates pass: size, dupes, layers, names, one-version, no-void, taxonomy, rask, shear, sdk-coverage and sdk-props.
  • A street front of all 14 classes, made in code, was baked at 16 texels a metre and rendered on the Mac:
    • The class view names every part correctly.
    • After 80 sooty years: a streaked cornice, drips under the sills, splash and a damp tide at the foot, a faded south door and a rusted railing.
    • Rain, snow with a storm, and autumn all render.
    • An unbaked sphere under the same shader is unchanged.

🤖 Generated with Claude Code

wearBake bakes a model's causes once (the native call, now typed), and wearShader draws them as wear by material
class: one WESL function per class (plaster, brick, sandstone, granite, wood, iron, zinc, copper, slate, felt, glass,
enamel, brass, ground), the stains, rising damp and splash they share, and WR9's season and weather over them, from
uniforms (age: years, soot, upkeep; weather: day, wet, snow, storm, ice). A debug mode draws any of 14 causes in false
colour from a lit hook. A mesh without the bake's second UV set is left as it was.

The bake (raea-sys-weathering 6) writes each texel's class into causes2's spare alpha, read by textureLoad, so one
shader serves every material; dilation copies class and element into the gutters instead of averaging two into a
third; a primitive with no UV set gets the atlas's as TEXCOORD_0 too, since Bevy's standard surface reads the first
wherever there's a second.

Proof: bun test in sdk/wear (12), cargo test -p raea-sys-weathering (11), and a street front of all 14 classes
baked and rendered by day, in rain, snow and autumn, and cause by cause.
@shinyobjectz
shinyobjectz merged commit 7d71973 into main Nov 19, 2026
4 checks passed
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