ImageBackground
The ImageBackground component displays images with depth information for parallax effects. This is ideal for:
- Creating depth-aware backgrounds
- Displaying stereo images for VR
- Building augmented reality overlays with depth
- Visualizing RGB-D camera feeds
Basic Usage
This example shows how to use background images + layers to play a 3D movie in the VisionPro and the Quest 3.
The underlying rendering engine supported a layer binary bitmask for both objects and the camera. Below we set the two image planes, left and right, to layers=1 and layers=2. Note that these two masks are associated with left eye's camera and the right eye's camera.
Key Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
key | str | - | Unique identifier for the background |
rgb | ndarray | - | RGB image array (HxWx3) |
depth | ndarray | - | Depth image array (HxW) |
distanceToCamera | float | 1.0 | Base distance from camera |
Learn More
For detailed examples of using ImageBackground, see:
- Depth Image - Depth-aware backgrounds
- VR HUD - Stereo image backgrounds