Repository navigation
raea/wear: crumbling (WR6), weather during a shot (WR9), the corner house demo (WR7); wear on the public hook (EX9) - #200
Merged
Merged
Conversation
…); WR9's weather during a shot Where a building breaks, by rules over the weathering bake's texels, in a crate of its own (raea-sys-damage 3): - cracks from the re-entrant corners of a wall's openings: a wall texel is beside one when, of eight probes across and up the wall, only one diagonal misses it; about half the corners crack (which ones by place, so a house cracks the same way every bake), each leaving away from the opening, steeper than 45 degrees, 0.35-1.25 m, wandering. causes3's alpha is each texel's distance to the nearest crack on its own wall. - the loss potential: how readily a coat comes off at the damp foot, where run-off soaks what the rain doesn't wash, at a knocked arris low down and along a crack (LOSS; raea/wear's test checks its copy against it). - debris on the walk under outdoor plaster with a high loss potential, dropped onto the walk from 0.2 m out (none where a plinth or step is below first, none from a wall the rain never reaches, a room's or a hollow model's back), each with its potential (spots.json "loss"); touch's old debris rule, which waited for this, is gone (raea-sys-touch 5). raea-sys-weathering 7 keys on raea-sys-damage's version. raea/wear draws it by neglect (years less what upkeep keeps up): render lost to the brick 2 cm behind it (drawn at the view's parallax) under a shadowed lip, paint to red-lead primer and the wood, enamel flaking to rusting iron, cracks no thinner than a pixel (stepped along brick's joints). What a lived-in house mends however poorly it is kept (panes, most slates, fallen render on its walk) goes only once it is left empty: abandonOf, neglect past ABANDON_FROM (0.85) by the house's own upkeep. wearSpots reads spots.json; wearDebris is the debris an age leaves lying; debug views crack and loss. WR9: weatherAt eases what lies on the surfaces (wet, snow, driven snow, frost) toward what the sky does, spell by spell, each at its own rate (WEATHER_RATES, ASSUMED: wet in about 3 minutes, dry over an hour), exactly, so any frame draws alone; WEAR_CONDITIONS are the eight conditions as weather. Tests: cargo test -p raea-sys-damage (5: an opening's four corners and no others, cracks along the wall, about half the corners crack, what loosens a coat, debris under outdoor plaster's foot and on the walk only), -p raea-sys-weathering (11), -p raea-sys-touch (9); bun test in sdk/wear (22).
A Berlin corner block made in code (house.ts): a sandstone plinth, a rusticated ground floor, plastered storeys, sills, a string course, a cornice on consoles under a hipped slate roof, a door in a sandstone surround up granite steps, an iron balcony, a zinc gutter and downpipe, an enamel street plate on each face of the corner, a cellar hatch, a brick firewall, the walk and the road. Its openings go through the walls with the glass 15 cm in, so cracks start at their corners; one glTF material per wear class. make-house.ts writes media/house.glb. wear.tsx bakes it once and draws it new, after 80 years of a coal-burning city, as a ruin (with the debris its age leaves lying, in lumps), at its door and its foot up close; each of the 16 causes in false colour; each of WR9's eight conditions by day and at dusk; and a shower crossing it as a timelapse (weatherAt). Rendered on the Mac, 0 errors on every still. Its tests (6) check the house's parts, the openings, the .glb and that the demo lists every cause and condition.
…s/examples.feature EX9) MeshStandardMaterial's wear and raea/pbr's <WearExtension> drew with the engine's own MaterialExtension (systems/wear). They now write the same shader on the public surface hook (sdk/render/src/worn.ts, WORN_WESL: the same noise, curvature edges, grime, rust and chips, in the mesh's own space), so wear is an author's shader like any other and raea/wear's weather and the paint wear share one path. A parity scene (sharp, turned and round parts, every setting) renders the same as before, RMSE 3.8e-5 of full scale. One change: clay draws custom surface shaders as they are, so worn paint now shows in a clay render, as a ShaderExtension's does. Deleted: systems/wear, its WearPlugin, its spawn branch, its mesh-row columns, its layer entries, and its type in the registry snapshot, bevy.gen.tsx and sdk-coverage (reached 1557 -> 1556: the type is gone; wear is still authored). wear with shader or grid on one material is refused (it was silently dropped). WearExtension keeps its props, so the guides are unchanged; it carries no @bevy tag of its own now, since its Bevy type is ShaderExtension's.
Their crates, files, lines and proof: raea-sys-damage and raea/wear's crumbling (WR6), the corner house demo with worn paint and EX9's deletion (WR7), and weather during a shot with the eight conditions named (WR9). WR8, detail textures from mask stacks and what they cost, is what's left of raea/wear.
…damage's copied raea-sys-foliage's) Neither crate can depend on the other (systems don't reach sideways), so the cubic Hermite ease goes down to raea-core-ease, the curves crate, and both use it; foliage keeps its name for it (smooth). Behaviour unchanged: cargo test -p raea-core-ease -p raea-sys-damage -p raea-sys-foliage pass.
…Aabb (two near copies folded) raea-sys-damage kept its debris in seed order with none nearer than a gap, as touch's thin() does for spots, and found a crack path's bounds with a fold pick.rs also has. touch's rule is now thin_by (any candidate with a place), which thin_if and damage's debris both use, and the bounds are Aabb::from_points. The same spots come out: cargo test -p raea-sys-touch -p raea-sys-damage -p raea-sys-weathering pass. Near-duplicate groups back to 58, so tools/dupes.max goes down to it.
…ilding the detail layers At 4K on the M5 Pro the corner house renders 17.2 ms a frame plain and 17.2 worn (17.6 and 17.7 again), so the recipes' per-pixel noise costs nothing a render can see; the bake's four maps hold 36 MB on the GPU, which BC7 would take to about 9 MB once the class code has a map of its own. WR8 stays open: the detail layers, mips on arrays (with them) and BC/KTX2 maps with a fallback where BC isn't.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
weatherAt(base, spells, minutes)eases wet, snow, driven snow and frost toward the sky's values at their own rates, exactly per spell, so any frame draws alone.WEAR_CONDITIONSnames the eight conditions.examples/materials/wear/). It shows the corner house made in code: new, after 80 sooty years, and as a ruin. There is a false-colour still of every cause, all eight conditions by day and at dusk, a shower as a timelapse, and worn paint with no bake.wear,<WearExtension>) is a surface shader on the public hook (sdk/render/src/worn.ts). raea-sys-wear, its plugin, spawn branch and row columns are deleted. A parity scene matches the old render (RMSE 3.8e-5). Its type leaves the registry snapshot, bevy.gen.tsx and sdk-coverage (reached 1557 → 1556, the type gone). The guides are unchanged.raea_core_ease::smoothstep(damage had copied foliage's).Tests that pass:
bun testin sdk/wear (22) and examples/materials/wear (7);cargo test -p raea-sys-damage -p raea-core-ease -p raea-sys-foliage -p raea-sys-weathering;Every still renders with 0 errors on the Mac.
🤖 Generated with Claude Code