Developing VPS Experiences
Enabling Lightship VPS
To enable VPS in your WebAR project, you'll need to set enableVPS
to true
.
For A-Frame projects, set enableVps: true
on the xrweb
component on the <a-scene>
For Non-AFrame projects, set enableVps: true
in the call to XR8.XrController.configure()
prior
to engine start.
Example - AFrame
<a-scene
coaching-overlay
landing-page
xrextras-loading
xrextras-runtime-error
...
xrweb="enableVps: true;">
Example - Non-AFrame
XR8.XrController.configure({enableVps: true})
// Then, start the 8th Wall engine
Developing Bespoke VPS Experiences
Bespoke VPS scenes are designed for a single Location and utilize a reference mesh from the Geospatial Browser to align AR content.
Part 1: Add Location to scene
- Open the Geospatial Browser (map icon 🗺 on the left)
- Find a VPS-activated Location (or nominate/activate your own)
- Add the Location to the project
Part 2: Use Location GLB as reference for custom AR animation
- Download the reference GLB from the right side of the row.
- Use this in your 3D modeling software (Blender, Maya, A-Frame, etc) to position AR content relative to the mesh origin.
IMPORTANT: The origin of this 3D model is the origin of the Location. DO NOT RESET THE ORIGIN OR YOUR CONTENT WILL NOT BE ALIGNED.
OPTIONALLY: If the mesh downloaded from the Geospatial Browser is not high enough quality to use for a baked animation, physics, or occluder material, you might consider taking a scan using a third-party application like Scaniverse and aligning that high-quality mesh with the one downloaded from the Geospatial Browser.
- Import animation GLB into Cloud Editor and add to scene
- Add the named-location component to your asset's
<a-entity>
. The 'name' attribute refers to the Project Location'sname
from the Geospatial Browser.
Ta-da! 🪄 Your animation should appear aligned to the Location in the real world.
Part 3: Adding occlusion and shadows
- In your scene, add
<a-entity named-location="name: LOCATIONNAME"><a-entity>
- Add three
<a-entity>
inside this element as its children. These will be your occluder mesh, shadow mesh and VPS animation. - In the first
<a-entity>
, addxrextras-hider-material
andgltf-model="#vps-mesh"
. "#vps-mesh
" should refer to a version of your reference GLB that has had its textures removed and geometry decimated. - In the second
<a-entity>
, addshadow-shader
,gltf-model="#vps-mesh"
, andshadow="cast: false"
. The shadow shader applies a shadow material to the reference mesh with a polygon offset to prevent Z-fighting. You can choose whether you want the vps-mesh to cast a shadow on the real world withshadow="cast: true"
. - In the third
<a-entity>
, addgltf-model="#vps-anim"
,reflections="type: realtime"
,play-vps-animation
andshadow="receive:false"
.play-vps-animation
waits until thevps-coaching-overlay
has disappeared before playing the VPS animation.