A room ready to bake light probes
Updated
The runtime Light Probes demo’s room: red and green walls, a lamp and a probe volume, with a Light Probe Solver on the scene root. The script reports the solver’s settings and whether the volume is baked; baking itself runs in the editor.
Read the log: in play the solver cannot bake, so the volume reports itself unbaked. Download the project and press Bake in XR Creator to see the walls' colours bleed onto the spheres. Drag to orbit the camera, scroll to zoom.
A room ready to bake light probes
#pragma lifecycle(startup)
async function startup() { const solver = scene.findEntity(scene.rootId).getComponent(LightProbeSolverComponent); const volume = findEntity('Light Probe').getComponent(LightProbeComponent); const { cubemapSize, bounces, softness, samples } = solver.props; log(`Solver: ${cubemapSize} px faces, ${bounces} bounces, softness ${softness}, ${samples} samples`); log('Volume baked:', volume.isBaked); if (volume.issue) log(volume.issue);
// bake() works in the editor only: in play it resolves false at once. const baked = await solver.bake(); log(baked ? 'Baked' : 'Bake in XR Creator: the solver bakes only in the editor');}Open it in XR Creator
Section titled “Open it in XR Creator”Download the project file below, then import it in XR Hub with Projects › New › Import, as described in Projects and templates. It opens in XR Creator with the same scene you see running above, each script already attached to its Behavior entity. From there you can edit the scripts, adjust components and their props, preview your changes, and deploy the result as a world of your own.
ProbeSolverRoom.xrproj