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

sky

Public Luau surface over the `__sky` Internal FFI namespace — sky type, time of day, day/night cycle, procedural parameters, presets, explicit sun direction.

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

sky Module

Public Luau surface over the __sky Internal FFI namespace — sky type, time of day, day/night cycle, procedural parameters, presets, explicit sun direction.

Purpose

Wrap the raw __sky.* FFI namespace in a typed Luau table that gets auto-injected as _G.sky via the prelude. Set queues sky-config mutations into the scripting mutation queue; get reads back via the sky-snapshot bridge.

Usage

sky.preset("clear_day")
sky.set({ time_of_day = 14, sync_sun_to_light = true })
print(sky.getTimeOfDay())                 -- 14
sky.setSunDirection({ 0.5, -1, 0.3 })

local cfg = sky.get()
print(cfg.type, cfg.material_name, cfg.solid_color)

Exports

  • sky.set(opts) / sky.get() -> table
  • sky.setTimeOfDay(t) / sky.getTimeOfDay() -> number
  • sky.preset(name)
  • sky.setSunDirection(dir)

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

global sky global-types module sky Sky configuration — type, time of day, day/night cycle, procedural parameters, presets, explicit sun direction. Public Luau surface over the `__sky` Internal FFI namespace. global sky require modules/api/engine/sky

set(opts: SkyOpts) → void

Configure the sky system. All fields are optional — only provided fields are updated. Color fields accept both named `{x=r, y=g, z=b}` and positional `{r, g, b}` forms. `color` is an alias for `solid_color`.

argtypedescription
optsSkyOptsSky configuration properties.

examples

sky.set({ type = "procedural", time_of_day = 14, sync_sun_to_light = true })

setTimeOfDay(time: number) → void

Set the time of day (0-24 hours). 0 = midnight, 6 = sunrise, 12 = noon, 18 = sunset.

argtypedescription
timenumberTime of day in hours.

examples

sky.setTimeOfDay(18.5)

getTimeOfDay( ) → number

Get the current time of day in hours (0-24).

examples

local t = sky.getTimeOfDay()

get( ) →

Get all current sky configuration as a table. Returns the same fields as `sky.set` accepts, plus read-only fields like `material_name` and `type`. Color values are returned as positional arrays `[r, g, b]`.

examples

local cfg = sky.get(); print(cfg.time_of_day)

preset(name: string) → void

Apply a named sky preset. Available: `clear_day`, `sunset`, `sunrise`, `overcast`, `night`, `studio`, `none`. Raises a Luau error for unrecognized names — wrap in `pcall` if uncertain.

argtypedescription
namestringPreset name (case-sensitive).

examples

sky.preset("sunset")

setSunDirection(dir: SkyColor) → void

Set an explicit sun direction and disable time-based sun positioning. The directional light is updated to match.

argtypedescription
dirSkyColorNormalized sun direction vector.

examples

sky.setSunDirection({ 0.5, -1, 0.3 })

installFallback( ) → void

Register the engine fallback sky material and install it as the engine-level fallback (rendered when a scene has no sky entity). Idempotent; requires a live renderer — the scene loader calls it.

examples

sky.installFallback()
⌬ Types
SkyColor = { x: number, y: number, z: number } | { number }SkyOpts = {

Sub-parts

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

7items
✦
shader · born here
❒asset
# procedural_sky The editable atmospheric sky: a day/night gradient with a sun disc and glow, a procedural star field, and a moon opposite the sun, authored entirely from material properties — no texture backs it. Day, night and the dawn/dusk blend all derive from the directional light's elevation, so the sky follows whatever drives the scene's sun; there is no time-of-day uniform. The gradient's zenith, horizon and ground colours, the sun's size and intensity, the stars, the moon, turbidity and exposure come from `properties.yaml`. Output is radiance scaled by `exposure` — the scene's own tone-mapping does the range compression, the same contract as every sky-domain shader. The `ProceduralSky` component owns the runtime material over this shader (`__procedural_sky`) and pushes its fields here; `sky.get()` reports the resulting configuration.
▲ 0↑ born
·
other · born here
▤file
▲ 0↑ born

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.