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

sky

The Painted Valley sky part's entry module (valley/sky.js and the sky's part of main.js): the hour table (KEYS, blend, sunAt, SUNSET), build / update / setHour / destroy, the field light pushed into the core, the dome material on a Skybox, the engine sun and ambient, and bindTo f…

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

sky

The Painted Valley sky part's entry module (valley/sky.js and the sky's part of main.js): the hour table (KEYS, blend, sunAt, SUNSET), build / update / setHour / destroy, the field light pushed into the core, the dome material on a Skybox, the engine sun and ambient, and bindTo for materials that mirror the sky. 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.sky — the sky of Painted Valley and the light that goes with it (valley/sky.js and the sky's part of valley/main.js, blendi/painted-valley on Patch, MIT). The part's entry module. The sky and the light that goes with it, from one number: the hour, from noon to sunset. The dome is a painted gradient, deep blue overhead and pale at the horizon, with the clouds laid over it from their cube map and the far mountains over those; the same colours light the grass, the far land, the clouds and the mountains. Colours are in linear light and meant to be seen as written: the frame's tone curve leaves everything below white alone. Port: createSkyParts / createSky / skyParts.light(hour) / sky.setHour / sky.update are here as build / light / setHour / update. The dome is the skyDome sky-domain shader on a Skybox (an unsynced, temporary entity the part spawns: the engine draws the sky from a Skybox's material). setHour pushes the field light into the core (core.setMany, the values the original hands field.setLight), sets the dome's own uniforms, relights the clouds, and sets the engine's own sun and ambient light to the same light (direction towards the sun; colour * intensity = the original's uSunColor and uSkyColor), so anything the engine lights agrees. The lights are the sky's own unsynced, temporary `paintedValley.sky.sun` / `paintedValley.sky.ambient` entities, written when the hour's light changes. A scene's authored (saved) Light entities are written only when the valley context states `sceneLights = true`, and the engine's light is left alone with `engineLight = false`.

LightSkybox

blend(e: number) → void

The hour's colours for a sun `e` degrees up: the two keys either side, mixed.

argtypedescription
enumber

clamp(x: number, a: number, b: number) → number

argtypedescription
xnumber
anumber
bnumber

sunAt(hour: number) → void

The sun at an hour, 12 to sunset: its direction (towards it, unit) and its degrees above the horizon. It comes down on the left of the way the valley runs and swings round towards it, so by evening it stands low over the mountains.

argtypedescription
hournumber

setProp(key: any, name: string, value: any) → void

argtypedescription
keyany
namestring
valueany

setTex(key: any, name: string, tex: any) → void

argtypedescription
keyany
namestring
texany

pushBound(key: any) → void

argtypedescription
keyany

bindTo(key: any) → void

Keep a material of yours up to date with what the sky shares (water.js): uZenith, uMid, uHorizon, uGlow (float3), uCloudFace (float) and the clouds' cube in tClouds. Its shader declares those and includes "paintedValley.sky.skyCommon" for skyAt / cloudsAt.

argtypedescription
keyany

unbind(key: any) → void

argtypedescription
keyany

createSkyParts(options: { [string]: any }?) → void

The sky's two pictures, the clouds and the far mountains, which need nothing from the land: made first, so the graphics card can be painting them while the land is worked out. `light(hour)` paints the clouds for an hour.

argtypedescription
options{ [string]: any }?

light(hour: number) → void

argtypedescription
hournumber

setHour(v: any, hour: number, soft: boolean?) → void

hour: 12 to sunset. `soft` (the driver's `quick`) for a small step, as time passing makes: the clouds then take the new light a strip at a time as they billow, and nothing is drawn again at once. (v: the valley context; v.core when the core is live.)

argtypedescription
vany
hournumber
softboolean?

setEngineLight(dir: { number }, sun: { number }, amb: { number }) → void

The engine's sun and ambient term set to the hour's light: the sun shining along -dir, its colour * intensity the original's uSunColor; the ambient's colour * intensity its uSkyColor. The lights are the sky's own (unsynced, temporary: "paintedValley.sky.sun", "paintedValley.sky.ambient"). With v.sceneLights == true they are the scene's own `sun` (directional) and `ambient` Light entities, found by name, where the scene has them. The lights are written when the light differs from what they were last given: the same hour writes nothing. With v.engineLight == false the sky leaves the engine's light alone.

argtypedescription
dir{ number }
sun{ number }
amb{ number }

sceneLight(name: string, kind: string) → any

The scene's Light of a kind on the entity of that name, if it has one.

argtypedescription
namestring
kindstring

makeLights(v: any) → void

argtypedescription
vany

makeDome( ) → void

The part

pump( ) → boolean

Advances the bakes the sky still owes (the far country's painting, the clouds' drawAll) by a frame's worth. Returns true while there is more.

ready( ) → boolean

Whether every picture the sky paints is painted.

build(v: any) → void

Make the sky: the clouds' cube and the far country's strip are painted (over the next frames: build yields until they are, when it can), the dome is put up and the hour set (v.hour, else 15.5).

argtypedescription
vany

update(v: any, dt: number) → void

Every frame, play and edit: the bakes still owed, then the clouds' strip for the frame.

argtypedescription
vany
dtnumber

destroy(v: any) → void

argtypedescription
vany

Sub-parts

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

Showing up to 3 levels deep. Open a part to see what it holds further down.

21+items
▣
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
▣
module · born here
❒asset
# 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.
▲ 0↑ born
✦
shader · born here
❒asset
The Painted Valley sky dome (valley/sky.js): the painted gradient, the sun and its glow, the clouds from their cube atlas and the far country from its painted strip, mixed with the hour's light. A sky-domain shader; the sky part (paintedValley.sky.sky) drives its properties. Its alpha is the frame's "already painted" tag, 1 - 0.75 * done, as the original writes it.
▲ 0↑ born
▣
module · born here
❒asset
# 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.
▲ 0↑ born
backing path · paintedValley/sky/sky.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 on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬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.