This guide provides the steps to setup and run the example project. The demo scene is located at Assets/_SpectatorMode/Scenes/PunSpectatorView.
- Open the photon server settings by selecting Window > PUN Wizard
- Select Setup Project from the Pun Wizard window.
- Configure your project to use your Photon App Id or an on premise server.
- To localize with Mobile devices, you will need to print out the Image Target.
- For the target to track correctly, the image size needs to be adjusted. The default is based on the standard size when printed on US printer paper (0.288 x 0.2036 meters). To adjust the size:
- Select the ARFReferenceImageLibrary asset under
Assets/Samples/NetworkAnchors/1.1.0/Examples/ImageTracking/ImageTarget
. - Change the Physical Size (meters) in the inspector to your prefered size.
- Open the PunSpecatorView scene located under
_SpecatorMode/Scenes/
- Search for the MagicLeapCoordinateProvider object in the Hierarchy and select it. Expand the Target Info section in the inspector and set the Longer Dimension (meters) value.
- Select the ARFReferenceImageLibrary asset under
- Open the Build Settings Window
- If you are not targeting Lumin already, select Lumin from the Platform list, then Switch Platform
- Make sure that at least the PunSpectatorView and MagicLeap_Spectator_Rig scenes are listed and enabled.
- Press Build
- Make sure your player settings are set to:
- Windows: x64 - D3D11/D3D12
- macOS: x64 or arm64 (M1), Metal
- Linux: x64, Vulkan
- Open the Build Settings Window
- If you are not targeting Lumin already, select PC, Mac & Standalone from the Platform list, then Switch Platform
- Make sure that at least the PunSpectatorView and MagicLeap_Spectator_Rig scenes are listed and enabled.
- Press Build
- This project uses KlakNDI to stream, iOS requires the NDI Advanced SDK to build on Xcode. Please download and install the NDI Advanced SDK for iOS in advance of building.
- Ensure you've downloaded the ARKit Package and selected it under Player Settings > XR Plug-in Management.
- Make sure your player settings are set to:
- iOS: arm64, Metal
- iOS > Other Settings > Camera Usage Description: "Camera Needed for AR"
- iOS > Other Settings > Scripting Define Symbols: Add "AR_FOUNDATIONS"
- Open the Build Settings Window
- If you are not targeting Lumin already, select iOS from the Platform list, then Switch Platform
- Make sure that at least the PunSpectatorView and ARFoundation_Spectator_Rig scenes are listed and enabled.
- Press Build
Note: Android does not support streaming through NDI
- Ensure you've downloaded the ARCore Package and selected it under Player Settings > XR Plug-in Management.
- Open the Build Settings Window.
- If you are not targeting Lumin already, select Android from the Platform list, then Switch Platform .
- Make sure that at least the PunSpectatorView and ARFoundation_Spectator_Rigscenes are listed and enabled.
- Press Build
The ARFoundation_Spectator_Rig scene contains an occlusion manager under ---AR Foundations--- > ARSessionOrigin > ARCamera > AR Occlusion Manager. By default this will hide the scene content if it is behind/blocked by physical objects. If you can't see the UI panel in the scenes, toggle "Occlusion" off in-app -- the panel might just be hiding behind an object.
To learn how to retrieve the streamed image, view our Streaming Guide