Warning
This repository is archived and no longer actively maintained.
This repository contains an example project demonstrating how to use Photon Fusion to create a colocation application for the Magic Leap 2. This project provides a simple multiuser and colocation application using Photon Fusion. The example is designed to work with the Magic Leap 2 and demonstrates the basics of creating a shared AR experience.
Before you start, please ensure that you have the following software and hardware:
- Unity 2022.x
- Magic Leap SDK and Unity Package
- Photon Fusion SDK
- A Photon Fusion account (for the AppID)
- Clone this repository to your local machine:
git clone https://github.com/magicleap/MagicLeapPhotonFusionExample.git
- Open the project in Unity.
- Set up your Photon Fusion AppID in the Photon Fusion Hub.
- Create a Magic Leap 2 Unity project
- Import the Universal Render Pipeline
- Download and import the Photon Fusion package
- Assign a Photon Fusion App ID
- Import the Magic Leap - Photon Fusion package
- Print out the AprilTag marker or export Magic Leap Map
- Build and Run the example scene
- Marker Tracking
- To colocate using marker tracking, print out marker
0
from the tag family36h11
- To colocate using marker tracking, print out marker
- Magic Leap Anchors
- To colocate using Magic Leap Anchors, localize into the same AR Cloud Space or share your Space manually
The project is organized as follows:
Assets/MagicLeap/PhotonFusionExample
├───DesktopARBackground/ # Contains materials for the 3D objects
├───Images/ # Contains the April Tag marker
├───Materials/ # Contains materials for the 3D objects
├───Models/ # Contains the virtual avatar models used in the scene
├───Prefabs/ # Contains prefabs for easy scene setup
├───Scenes/ # Contains the example scenes for marker and anchor colocation
├───Scripts/ # Contains custom C# scripts for the project
├───Editor/ # Scripts installing the generic marker tracker
├───MagicLeapSpaces/ # Scripts for localizing the Magic Leap into a device or AR Cloud Space
├───MarkerTracking/ # Scripts for Magic Leap and generic marker tracking
├───PhotonFusion/ # Scripts coupled to Photon Fusion
├───Utilities/ # Scripts such as a ThreadDispatcher
└───Sprites/ # Contains textures for UI
└───ThirdParty/ # Contains a modified version of the April Tag for Unity
└───URP/ # Contains the Universal Render Pipeline assets
└───Webcam/ # Contains components to obtain a generic webcam stream
- This project uses a modified version of the AprilTag package for Unity which is licensed under BSD 2-Clause
- This project uses the Keijiro Takahashi's TestTools Package which is licensed under The Unlicensed
This project is governed by the Magic Leap 2 License Agreement