Tint a capture for dusk
Updated
On sky/dusk, a tween blends a Splat Mesh’s color from white to a warm dusk tint over six seconds.
Press Dusk to warm the capture over six seconds. Drag to orbit the camera, scroll to zoom.
Tint a capture for dusk
#pragma lifecycle(startup)
const DAY = new THREE.Color('#ffffff');const DUSK = new THREE.Color('#ffb27a');const mixed = new THREE.Color();
function startup() { const capture = self.parent.getComponent(SplatMeshComponent);
on('sky/dusk', () => { Tween.value(0, 1, (t) => { mixed.copy(DAY).lerp(DUSK, t); capture.setProps({ color: `#${mixed.getHexString()}` }); }, { duration: 6, ease: Ease.InOutSine }); });}How it works
Section titled “How it works”The script is explained step by step in Tint a capture for dusk.
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.
SplatDusk.xrproj