backdrop
valley/backdrop.js: the far country's height map (backdropHeight) and its painted strip (backdropPaint, three RGBA8 targets), drawn once in strips over a few frames. See ../README.md.
backdrop
valley/backdrop.js: the far country's height map (backdropHeight) and its painted strip (backdropPaint, three RGBA8 targets), drawn once in strips over a few frames. See ../README.md.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2paintedValley.sky.backdrop — the far country of Painted Valley (valley/backdrop.js, blendi/painted-valley on Patch, MIT). The far country, painted once: wooded foothills, a range of snow mountains behind them and a paler range behind that, drawn the way a matte painter would, into a strip of picture that wraps the horizon. It stands too far off for a walk to shift it, so it can be worked as hard as a painting is. What is kept is the paint and not the picture: each point's colour in the light, its colour in shade, how lit it is and how much air lies in front of it. The sky's dome mixes those with the hour's light, so the hour can change without the mountains being painted again. It is made in two goes. The ground's height is worked out once into a map (backdropHeight); the painting then reads the map (backdropPaint), which is what lets it look a long way along every ray, cast every shadow, and still be ready in a moment. Port: the original draws the map in 8 upright strips and the picture in 48, all in one go; here each strip is a dispatch and paint() lays them out over frames (pump), a few a frame, so no one frame holds the GPU for long. The three draw buffers are three RGBA8 storage textures; the height map is RGBA16F (the original's half floats).
create(hero: { number }, side: { number }, options: { width: number?, ground: number? }?) → void
side: the afternoon sun's level direction (x, z), which side the mountains are lit from. options.width: texels round the horizon; options.ground: texels along a side of the height map.
| arg | type | description |
|---|---|---|
| hero | { number } | |
| side | { number } | |
| options | { width: number?, ground: number? }? |
heightStrip(i: number) → void
| arg | type | description |
|---|---|---|
| i | number |
paintStrip(i: number) → void
| arg | type | description |
|---|---|---|
| i | number |
paint( ) → void
Works the ground out and paints the whole strip, once (laid out over the next frames: see pump).
pump( ) → number
Draws what paint() still owes, up to a frame's worth. Returns how many steps are left.
ready( ) → boolean
dropHeights( ) → void
The height map is wanted only while the picture is painted: let it go once it is.
free( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.