ViroCameraTexture binds a live device camera feed to a named material's diffuse texture, allowing any geometry to display a real-time camera view (mirror surfaces, picture-in-picture, VR selfie). Unlike frontCameraEnabled on ViroARSceneNavigator — which replaces the full-screen AR background — ViroCameraTexture keeps back-camera AR tracking active while painting the camera feed onto a surface.
Import
import { ViroCameraTexture } from "@reactvision/react-viro";
Props
material
Type
Description
string
Name of a material (created via ViroMaterials.createMaterials) whose diffuse texture will be bound to the live camera feed. Typically use the "Constant" lighting model.
cameraPosition
Type
Description
"front" | "back"
Which device camera to bind to the texture.
paused
Type
Description
boolean
Pause/resume the camera feed.
onCameraReady
Type
Description
() => void
Fired when the camera feed is ready and bound to the material.
A ref may be attached to the component (see example).