PaintedSkies
The paintedSkies API: `require("~paintedSkies.PaintedSkies")`.
PaintedSkies
The paintedSkies API: require("~paintedSkies.PaintedSkies").
use(id, { transition?, keepOverrides? })swaps the whole sky for every player by setting the syncedpresetof the scene's PaintedSky (spawning a synced one if the scene has none). Returns false for an unknown id.presets()lists every skyPreset id;preset(id)resolves one.current()answers{ preset, values, overrides }.set(overrides)replaces preset fields on top of the preset, shared.toProperties(values)turns preset values into the sky shader's properties;shownProperties()is what is on the material now.
Internally the PaintedSky component calls attach, show, step and
detach. The sky is ONE runtime material (paintedSkies.sky) bound once;
preset changes and cross-fades push property values onto it, never swapping
the material, which keeps runtime changes visible despite engine issue #4701.
With matchLighting, show also sets the scene's sun and ambient light.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2PaintedSkies: one call swaps the whole hand-painted sky. local Skies = require("~paintedSkies.PaintedSkies") Skies.use("goldenSunset") -- every player, cross-faded Skies.presets() -- { "clearBlue", "goldenSunset", ... } Skies.current() -- { preset = "goldenSunset", values = {...} } Skies.set({ towers = 0.9 }) -- tweak on top of the preset, shared The sky draws through ONE runtime material (`paintedSkies.sky`) bound once through the native Sky component. A preset change never swaps that material: it pushes the preset's values onto it with `renderer.material.setProperty`, which the sky pass reads every frame (the workaround for engine issue #4701, where a sky material swapped at runtime is not followed by the sky pass).
shaderIdentity( ) → string
The shader and the ten presets are named here by their place in this package (`~paintedSkies...`), not by a path from the world's root: the names resolve wherever paintedSkies is installed (at the root, or under deps/ when another package brings it along), and an install, which takes the assets a package names, brings every one of them.
clearBlue( ) → void
goldenSunset( ) → void
neonNight80s( ) → void
pastelDawn( ) → void
purpleDusk( ) → void
rainyGrey( ) → void
starryNight( ) → void
storm( ) → void
summerClouds( ) → void
toweringClouds( ) → void
shippedRef(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
toLinear(c: any) → void
| arg | type | description |
|---|---|---|
| c | any |
dirFromAngles(azDeg: number, elDeg: number) → void
| arg | type | description |
|---|---|---|
| azDeg | number | |
| elDeg | number |
contract( ) → any
leaf(identity: string) → string
| arg | type | description |
|---|---|---|
| identity | string |
presets( ) →
Every sky preset this world can use, by id: the package's eight plus any `.data` asset bound to the `skyPreset` contract.
presetRef(id: string) → any
| arg | type | description |
|---|---|---|
| id | string |
preset(id: string) → Values
The resolved values of one preset (the contract's defaults filled in), or nil when no preset has that id.
| arg | type | description |
|---|---|---|
| id | string | A preset id, e.g. "summerClouds". |
toProperties(values: Values) → void
Turn preset values into the sky shader's property table (linear colours, unit directions, radians).
| arg | type | description |
|---|---|---|
| values | Values | Preset values, as `preset(id)` returns them. |
ensureMaterial( ) → void
bindSky( ) → void
same(a: any, b: any) → boolean
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
push(props: { [string]: any }) → void
| arg | type | description |
|---|---|---|
| props | { [string]: any } |
lerpProps(a: { [string]: any }, b: { [string]: any }, t: number) → void
| arg | type | description |
|---|---|---|
| a | { [string]: any } | |
| b | { [string]: any } | |
| t | number |
applyLighting(values: Values) → void
| arg | type | description |
|---|---|---|
| values | Values |
attach(id: string, host: any) → void
Called by a PaintedSky component when it wakes: makes the sky material and binds it to that entity.
| arg | type | description |
|---|---|---|
| id | string | The entity id that carries the sky. |
| host | any | The component's public table. |
detach(id: string) → void
Called by a PaintedSky component when it goes away.
| arg | type | description |
|---|---|---|
| id | string | The entity id that carried the sky. |
show(presetId: string, overrides: Values?, seconds: number, matchLighting: boolean) → boolean
Resolve a preset plus overrides and show it, cross-fading over `seconds` (0 = at once). Called by the component.
| arg | type | description |
|---|---|---|
| presetId | string | Preset id. |
| overrides | Values? | Preset fields to replace. |
| seconds | number | Cross-fade length. |
| matchLighting | boolean | Whether to set the scene's sun and ambient to the preset's. |
step(dt: number) → void
Advance a cross-fade. Called every frame by the component.
| arg | type | description |
|---|---|---|
| dt | number | Seconds since the last frame. |
findHost( ) → any
ensureHost( ) → any
canWrite(id: string?) → boolean
| arg | type | description |
|---|---|---|
| id | string? |
listen( ) → void
run(op: { [string]: any }) → boolean
| arg | type | description |
|---|---|---|
| op | { [string]: any } |
applyOp(op: { [string]: any }) → void
| arg | type | description |
|---|---|---|
| op | { [string]: any } |
use(presetId: string, opts: { transition: number?, keepOverrides: boolean? }?) → boolean
Swap the whole sky to a preset for every player (cross-fades during play). Spawns a PaintedSky entity when the scene has none. Any player can call it: a player who does not own the sky sends the change to its owner, who applies it for everyone.
| arg | type | description |
|---|---|---|
| presetId | string | A preset id from `presets()`. |
| opts | { transition: number?, keepOverrides: boolean? }? | Optional `{ transition = seconds, keepOverrides = bool }`. |
examples
require("~paintedSkies.PaintedSkies").use("starryNight")set(overrides: Values) → void
Change individual preset fields on top of the current preset, for every player. Pass a table of preset fields; `{}` clears every override.
| arg | type | description |
|---|---|---|
| overrides | Values | Preset fields, e.g. `{ towers = 0.9, sunElevation = 20 }`. |
examples
require("~paintedSkies.PaintedSkies").set({ towers = 1, cloudShade = "#7f93c4" })clear( ) → boolean
Take the painted sky off for every player: the PaintedSky entity goes, the scene's own sky shows again, and every machine puts back the sun and ambient light the scene had before the sky set them. Any player can call it. Returns true when there was nothing to take off or the change landed or was sent to the sky's owner.
examples
require("~paintedSkies.PaintedSkies").clear()current( ) → void
The sky being shown: its preset id, the resolved values (overrides applied) and the overrides alone.
shownProperties( ) → void
The shader properties last pushed to the sky material (what is on screen now).
Values = { [string]: any }PaintedSkies module: swap the whole painted anime sky with one call. use(presetId) for every player, presets(), current(), set(overrides), preset(id), toProperties(values). Pushes preset values onto one runtime sky material instead of swapping materials (works around engine issue #4701).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.
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.