Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld 07158574-5…

Skybox

The scene's sky as a single **material**. Add it to an entity and the engine renders that material across the sky behind everything else:

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

Skybox

The scene's sky as a single material. Add it to an entity and the engine renders that material across the sky behind everything else:

entity.spawn("sky").component.add("Skybox", { material = "sky_cubemap" })
entity.spawn("sky").component.add("Skybox", { material = "my_custom_sky" })
entity.spawn("sky").component.add("Skybox", { kind = "none" })  -- explicit no sky

Skybox is the generic, material-driven sky: it points at any sky material — a builtin (sky_procedural, sky_solid, sky_cubemap, sky_equirect) or your own authored sky-domain material — and makes it the active sky. For the editable procedural atmosphere (day/night, sun, stars, moon), use the ProceduralSky component instead — it is a Skybox over the sky_procedural material plus typed parameter controls.

A Skybox materialises its material's GPU handle when it binds it. The sky's point-of-use is the sky pass, which never binds the material the way a Model does, so the component performs the Disk→CPU→GPU upload (:handle()) itself. The renderer binds the sky by the material's identity (the key it is resident under once materialised), so a material-mode sky renders correctly after boot and mode flips — no manual :handle() needed.

Like the directional light, the sky is conceptually singular per scene: the engine copies the most recently authored sky into the scene-wide sky config the renderer reads each frame. A sky belongs to the scene that spawned it; removing the component reverts the scene to the engine fallback sky. State is bridged through the native Sky ECS component (sky type material / none), so there is no global sky singleton — two scenes can never clobber each other.

Fields

FieldTypeDefaultMeaning
materialstringsky_proceduralThe sky material to render. Any registered material whose shader is a sky-domain shader. Defaults to the procedural sky so an empty Skybox{} is never a black void.
kindstringmaterial"material" renders material; "none" turns the sky pass off — the explicit authored form of "this scene has no sky".

Methods

MethodDescription
skybox:setMaterial(name)Point the sky at a different material (materialises its handle).
skybox:setNone()Turn the sky off explicitly.

Interface

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

conforms to

zero/source-extract/v2

Skybox Component The scene's sky, expressed as a single material. Add it to an entity and the engine renders that material across the sky behind everything else: entity.spawn("sky").component.add("Skybox", { material = "sky_cubemap" }) entity.spawn("sky").component.add("Skybox", { material = "my_custom_sky" }) entity.spawn("sky").component.add("Skybox", { kind = "none" }) -- no sky A `Skybox` is the generic, material-driven sky: it points at ANY sky material (a builtin like `sky_cubemap` / `sky_solid` / `sky_equirect`, or your own authored sky-domain material) and makes it the active sky. For the editable procedural atmosphere with day/night, sun, stars and moon, use the `ProceduralSky` component instead — it is a `Skybox` over the `sky_procedural` material plus typed controls for its parameters. A Skybox materialises its material's GPU handle when it binds it: the sky's point-of-use is the sky pass, which never binds the material the way a Model does, so the component owns the Disk→CPU→GPU upload (`:handle()`) itself — the same point-of-use bind Model.component performs. The renderer binds the sky by the material's IDENTITY (the key the material is resident under once materialised), so `material_name` carries that identity. Like the directional light, the sky is conceptually singular per scene: the engine copies the most recently authored sky into the scene-wide sky config the renderer reads each frame. A sky belongs to the scene that spawned it — removing the component reverts the scene to the engine fallback sky. Config is the native Sky ECS component (sky_type "material" / "none"), driven through the typed ecs.Sky API, so there is no global sky singleton — two scenes can never clobber each other.

materialiseSkyMaterial(material: string) → string

Resolve the authored material identity to a live, GPU-RESIDENT material and return the key the renderer's sky pass binds by. Mirrors Model.component's point-of-use bind: `:handle()` performs the Disk→CPU→GPU upload so the sky material actually reaches the renderer registry — without this the sky pass misses the lookup and renders black. A material becomes resident under its IDENTITY, so that is what the native Sky's `material_name` must carry (a bare leaf name or an unmaterialised identity both miss). Resolve by identity; a material that resolves to nothing is passed through unchanged so the failure is a visible broken bind, not a silent swap.

argtypedescription
materialstring

skyValue( ) → void

The native bridge component is "Sky". kind="none" drives the native "none" sky type (material ignored); otherwise the `material` sky type renders `public.material`, materialised GPU-resident first so it isn't black.

awake( ) → void

onPropertyChanged(key: ?, value: ?, _oldValue: ?) → void

argtypedescription
key?
value?
_oldValue?

onDestroy( ) → void

setMaterial(material: string) → void

Point the sky at a different material. Materialises the material's GPU handle so it renders (not black) after boot.

argtypedescription
materialstringThe material name/identity to render as the sky.

examples

skybox:setMaterial("sky_cubemap")

setNone( ) → void

Turn the sky off explicitly (no sky pass) — the authored "no sky" form.

examples

skybox:setNone()

Sub-parts

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

5items
▣
module · born here
❒asset
# environment Module Environment / reflection capture — bake the scene into reflection-probe cube slots from world positions, persist them as `faces6` `.texture` assets, set per-probe blend data so surfaces reflect the probes covering them, and capture the sky into its own slot as the fallback under them. Public Luau surface over the `__environment` Internal FFI namespace, auto-injected as `_G.environment` via the prelude. ## Purpose The generic "render the scene into a cubemap from a point" capability the reflection-probe system is built on. Captures are queued for the render system (which owns the live scene); `captureSlotToAsset` additionally yields a few frames while the GPU readback completes. Persisted cubes are `faces6` `.texture` assets (px/nx/py/ny/pz/nz PNGs + a `cube.yaml` sidecar — see `docs/specs/cubemap-textures.md` §4 for the face convention). For probe authoring use the higher-level `reflectionProbe` module; reach for `environment` when you need the raw per-slot primitives. ## Usage ```luau -- Register probe blend data: index i maps to cube slot i. environment.setProbes({ { x = 0, y = 2, z = 0, radius = 12 } }) -- Bake slot 0 from a point (queued, next frame). environment.captureSlot(0, 0, 2, 0) -- Bake + persist to /source/probe_lobby.texture/ (yields; call from a -- task/coroutine/execute context). local path, err = environment.captureSlotToAsset("probe_lobby", 0, 0, 2, 0) -- Restore a persisted cube into a slot WITHOUT re-rendering. environment.loadSlotFromAsset("probe_lobby", 0) -- Capture the sky alone into the fallback slot: a surface no probe covers -- reflects the sky rather than black. environment.captureSky() ``` ## Exports - `environment.setProbes(probes) -> boolean` — set active probes' blend data; array of `{ x, y, z, radius, priority? }`, index i → cube slot i, gathered highest `priority` first - `environment.captureSky(x?, y?, z?) -> boolean` — render the sky alone into the fallback slot and arm it (queued) - `environment.setSkyFallback(active) -> boolean` — arm/disarm the fallback against the sky already captured (arming is refused while the slot holds none) - `environment.captureSlot(slot, x, y, z) -> boolean` — bake the scene into a slot from a point (queued) - `environment.captureSlotToAsset(name, slot, x, y, z, timeoutFrames?) -> (string?, string?)` — bake + persist as a `faces6` `.texture`; yields - `environment.loadSlotFromAsset(name, slot) -> (boolean, string?)` — upload a persisted cube into a slot without re-rendering Back-compat single-global-reflection helpers (slot 0 + one full-coverage probe): - `environment.capture(x, y, z) -> boolean` - `environment.captureToAsset(name, x, y, z) -> (string?, string?)` - `environment.loadFromAsset(name) -> (boolean, string?)`
▲ 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.