Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 7f138801-7…

clouds

valley/clouds.js: the hand-laid cumulus (mulberry32 layout), the billow numbers, and the cloud cube (a five-face RGBA16F atlas) drawn by cloudMarch a strip at a time: setLight, drawAll, update. See ../README.md.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2d ago
What it does

clouds

valley/clouds.js: the hand-laid cumulus (mulberry32 layout), the billow numbers, and the cloud cube (a five-face RGBA16F atlas) drawn by cloudMarch a strip at a time: setLight, drawAll, update. 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/v2

paintedValley.sky.clouds — the clouds of Painted Valley (valley/clouds.js, blendi/painted-valley on Patch, MIT). The clouds: summer cumulus painted the way a background artist would, as a few big simple masses with bright tops, blue shadow sides and flat darker bases. Each cloud is a heap of spheres whose surface is pushed about by billowing noise; a ray marcher draws them into a cube map round the valley, one strip a frame, so they can cost what they like and the sky itself is a single lookup. Port: the layout and the billows' random numbers are the original's, drawn from the same mulberry32 streams in the same order. The billow volume is filled on the GPU (cloudBillow), the cube is marched by cloudMarch into a five-face RGBA16F atlas (see skyCommon.shaderModule). drawAll() repaints every face; where the original does that in one go, here it is laid out over a few frames (STRIPS_PER_FRAME strips a frame) so no one frame holds the GPU for long. update() is the original's: one strip of one face a frame while `live`.

mulberry(seed: number) → void

mulberry32, as clouds.js has it.

argtypedescription
seednumber

billowNumbers( ) → void

The random numbers billowTexture(64) draws from mulberry(90210), in its order: grid(3), grid(6), grid(12), grid(24) (three a cell), then lattice(4), lattice(8), lattice(16). One flat array (the GPU rounds each to f32, as the original's Float32Arrays did).

layout(hero: { number }) → void

The sky's clouds, laid out by hand round the way the valley runs: a tower over the mountains ahead, two more heaped clouds to either side of it, fair-weather cumulus scattered nearer, and a bank lying along the mountains' feet. Metres, with the start of the walk at the origin. Returns { { puffs = { {x, y, z, r} }, base, scale } }.

argtypedescription
hero{ number }

at(u: number, v: number) → void

argtypedescription
unumber
vnumber

heap(into: { any }, x: number, y: number, z: number, w: number, h: number, n: number) → void

A rounded mound of puffs, `w` across and `h` tall, its middle at (x, y, z): one head of a cloud.

argtypedescription
into{ any }
xnumber
ynumber
znumber
wnumber
hnumber
nnumber

cumulus(u: number, v: number, base: number, width: number, height: number, puffs: number, heads: number?) → void

A cumulus: a flat-based cloud `width` across and `height` tall. `heads` more mounds are heaped on the first, each smaller and higher, leaning one way, as a real tower builds.

argtypedescription
unumber
vnumber
basenumber
widthnumber
heightnumber
puffsnumber
headsnumber?

pack(list: { any }) → void

The puffs, the clouds' bounding spheres and their info, packed as the original's uniforms are (the first MAX_PUFFS puffs; every unused slot zero). Also returns how many puffs the layout holds in all.

argtypedescription
list{ any }

setVec(u: { number }, at: number, v: { number }) → void

argtypedescription
u{ number }
atnumber
v{ number }

create(hero: { number }, options: { size: number?, steps: number?, live: boolean? }?) → void

Make the clouds: options.size texels along a side of each face of the cube; options.steps the marcher's; options.live false to draw the clouds once and leave them. Returns the cloud set (see below).

argtypedescription
hero{ number }
options{ size: number?, steps: number?, live: boolean? }?

billowOnce( ) → void

flush( ) → void

draw(unit: number) → void

argtypedescription
unitnumber

setLight(l: { [string]: any }) → void

The light on them. Any of: sunDir, lit, mid, shade, under, haze (arrays {r, g, b} in linear light).

argtypedescription
l{ [string]: any }

drawAll(now: boolean?) → void

Every face: at the start, and whenever the light changes. (They hold their shape: redrawn a strip at a time, clouds that billowed moved in jumps; uTime stays 0.) Laid out over the next frames, STRIPS_PER_FRAME a frame; `now` draws them all at once.

argtypedescription
nowboolean?

pump(budget: number?) → number

Draws up to `budget` strips of what drawAll still owes. Returns how many are left.

argtypedescription
budgetnumber?

ready( ) → boolean

Whether drawAll has drawn every face.

update(dt: number) → void

One strip of one face a frame: the clouds billow slowly, and nobody pays for it. (And what drawAll still owes, a few strips a frame.)

argtypedescription
dtnumber

free( ) → void

Frees the clouds' GPU resources.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

17items
▣
module · born here
❒asset
# paintedValley.world The land of Painted Valley (port of blendi/painted-valley src/valley/world.js, MIT): heightAt, land, paint/paintAt, pathDistance, tarnDistance, riverDistance, fieldsAt, forestAt, fbm, ridged and the valley's fixed places (HERO, START, TREE, VILLAGE, TARN). Bit-exact with the original (integer hash included). Every part uses it for CPU placement; the GPU twin is paintedValley.core.valleyLand.
▲ 0↑ born
·
computeshader · born here
❒asset
Fills the clouds' 64³ RGBA16F billow volume (valley/clouds.js billowTexture): rounded lumps at three sizes and a smooth value field, from the original's own mulberry(90210) numbers, rounded to half precision as three.js rounded them. Run once by paintedValley.sky.clouds.
▲ 0↑ born
·
computeshader · born here
❒asset
Ray-marches Painted Valley's painted cumulus (valley/clouds.js) into the sky's cloud cube, held as a five-face RGBA16F atlas: one strip of one face a dispatch, with the light of the hour. Driven by paintedValley.sky.clouds.
▲ 0↑ born
backing path · paintedValley/sky/clouds.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.