Apply a built-in preset
Updated
A statue turns into a hologram when the scene starts, and the log lists every built-in shader preset: a Shader Material added by a Behavior script with the hologram preset.
Read the list of presets in the log. Drag to orbit the camera, scroll to zoom.
Apply a built-in preset
#pragma lifecycle(startup)
function startup() { for (const preset of ShaderPreset.list()) { log(preset.name, '-', preset.label); }
const target = self.parent; let material = target.getComponent(ShaderMaterialComponent); if (!material) { material = new ShaderMaterialComponent({ preset: 'hologram' }); target.addComponent(material); } else { material.setProps({ preset: 'hologram' }); }}How it works
Section titled “How it works”The script is explained step by step in Apply a built-in preset.
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.
HologramPreset.xrproj