User Representation
HoloMIT SDK provides a modular system to define and control how each user is visually and functionally represented within a session. Whether you use a 3D avatar, webcam feed, or a full volumetric capture pipeline, the SDK offers a flexible framework to register, instantiate, and extend representations at runtime.
What Is a User Representation?
A User Representation defines how a user appears in the virtual world and what capabilities they have (e.g., audio, video, interaction). Examples include:
- A 3D avatar
- A 2D webcam
- A full volumetric reconstruction
- A non-visual participant (e.g., spectator)
These representations are identified via UserRepresentationType
, which can be built-in or user-defined.
Built-in Representations
Out-of-the-box, HoloMIT includes predefined types such as:
ID | Display Name | Interactions |
---|---|---|
AVATAR | 3D Avatar | ✅ |
WEBCAM | 2D Video | ✅ |
HOLOCAPTURER_DEPTH | HoloCapturer | ✅ |
SPECTATOR | Audio only / No rendering | ❌ |
NONE | No audio / No rendering | ❌ |
You can list them at runtime using:
UserRepresentationType.GetAll();
Core Components
Representation Type
- Each type is a unique ID + display name.
- Custom types can be created via:
UserRepresentationType.CreateAndRegister("MY_REP", "My Custom Representation", true);
Handler Logic
- A handler defines how to set up a given representation.
- Must implement:
public interface IUserRepresentationHandler {
void Setup(RepresentationSetupContext context);
}
Registry
- All handlers must be registered in:
RepresentationHandlerRegistry.Register(UserRepresentationType, IUserRepresentationHandler);
UI Integration
- Optionally associate icons, labels and descriptions via:
RepresentationUIRegistry.Register(UserRepresentationType, icon, suffix, lobbyText, description);
This enables UI dropdowns, labels and tooltips in the lobby or session selector.
How to Create a New Representation
- Create a type:
var myType = UserRepresentationType.CreateAndRegister("MY_CUSTOM", "My Custom", true);
- Implement handler:
public class MyCustomHandler : IUserRepresentationHandler {
public void Setup(RepresentationSetupContext context) {
// Load model, apply materials, modify parameters, etc.
}
}
- Register it:
RepresentationHandlerRegistry.Register(myType, new MyCustomHandler());
- (Optional) Add UI support:
RepresentationUIRegistry.Register(myType, "Icons/MyIcon", " - (Custom)", "CUSTOM USER", "Custom visual representation");
Runtime Setup Flow
At runtime, when a player joins:
- The system checks the
UserRepresentationType
- It calls
TryGetHandler(type, out handler)
- If found, the handler receives a
RepresentationSetupContext
and instantiates the representation
The context includes:
- The player instance
- Whether the user is local or remote
- Whether it's a preview or full setup
- Source type (e.g. webcam, volumetric, etc.)
Benefits of This System
- 🧩 Modular – Add or replace representations without changing core logic
- ♻️ Extensible – Add custom pipelines, rendering systems, etc.
- 🧠 Consistent – Uses the same flow across built-in and external handlers
- 🎨 UI-ready – UI registry enables dropdowns, previews, tooltips
Tip: If you're building your own capture/rendering pipeline, integrate it by creating a custom handler and registering it with your own
UserRepresentationType
.