Log inGet started

reflectionProbe

The reflectionProbe namespace — the engine's Luau API reference for reflectionProbe.

The reflectionProbe namespace — 10 functions.

globals/reflectionProbe/add

globals/reflectionProbe/add(x: number, y: number, z: number, opts: { [string]: any }?) -> string

Add a reflection probe at (x, y, z) in one call: spawns a probe entity carrying a ReflectionProbe component (which registers it and, unless opts.bake == false, bakes it). The probe is an editor gizmo — invisible in play mode. Returns the probe entity id.

globals/reflectionProbe/apply

globals/reflectionProbe/apply() -> number

Push the current active-probe blend data (live positions + radii) to the renderer. Builds a dense slot array so each probe's data lands at its cube slot; freed/missing slots become inert placeholders. Called automatically by add / bake / remove; call it directly after moving a probe entity.

globals/reflectionProbe/bake

globals/reflectionProbe/bake(id: string) -> (string?, string?)

Bake the scene into probe id's cube slot from its current position AND persist it to a faces6 .texture asset (so it survives reload + syncs), then re-apply the probe set. Yields a few frames; call from a task/coroutine context (component hook via task.spawn, bakeAll, or execute).

globals/reflectionProbe/bakeAll

globals/reflectionProbe/bakeAll() -> { baked: number, failed: number, errors: { string } }

Bake EVERY registered probe in the active layers, in one call. Captures each probe's scene from its position into its slot, persists it, and applies the full probe set. The agent/editor one-liner. Yields; call from a task/coroutine context (execute, a tool, or task.spawn).

globals/reflectionProbe/count

globals/reflectionProbe/count() -> number

Number of registered probes.

globals/reflectionProbe/list

globals/reflectionProbe/list() -> { any }

List every registered probe: { { id, slot, radius, asset, position }, ... }.

globals/reflectionProbe/loadBaked

globals/reflectionProbe/loadBaked(id: string) -> boolean

Load probe id's PERSISTED baked cube (probe_<key>.texture) into its slot WITHOUT re-rendering the scene — the runtime path. A probe bakes once at authoring time and loads the asset on every subsequent scene load. Returns false (not an error) when no baked asset exists yet.

globals/reflectionProbe/register

globals/reflectionProbe/register(id: string, radius: number, key: string?) -> number?

Register a reflection probe for entity id with influence radius. Assigns a free cube slot and applies the updated probe set. Idempotent — a re-register keeps the same slot and just updates the radius. Called by the ReflectionProbe component's awake; rarely called directly.

globals/reflectionProbe/setRadius

globals/reflectionProbe/setRadius(id: string, radius: number)

Update a probe's influence radius and re-apply.

globals/reflectionProbe/unregister

globals/reflectionProbe/unregister(id: string)

Unregister entity id's probe, freeing its cube slot, and re-apply.

  • api
  • reference