-
-
Notifications
You must be signed in to change notification settings - Fork 21
Visor lifecycle
Bogdan T. edited this page May 23, 2025
·
31 revisions
Visor supports 3 play modes. Each mode controls whether the VR session is initialized and when VR is rendered
-
Behavior
- VR session is initialized on startup, and is playable from main menu
- Require VR runtime & hardware
-
Behavior
- VR session is initialized same as VR_ENABLED, but is playable only in world
- Require VR runtime & hardware
-
Behavior
- VR session never ininitialize
- Does not require VR runtime & hardware
- Modifies only rendering of remote VR players (if connected to server supporting Visor through mod or plugin)
Three Boolean flags control runtime behavior:
| Flag |
true means… |
false means… |
|---|---|---|
VR_INITIALIZED |
VR session has been successfully created and is ready for rendering | No VR session is available; VR cannot render |
VR_ACTIVE |
VR is rendering | Rendering falls back to vanilla |
VR_FOCUSED |
VR is fully functional | In-game menu overlay is shown and non-essential VR visuals are disabled to save performance. |
State is updated at the beginning of mc game loop
-
Initialization
- On startup, after mc resources are loaded (unless in
VR_DISABLEDplay mode), attempt to initialize VR. - If successful, set
VR_INITIALIZED = true. - On failure, changed Play Mode to DISABLED
- On startup, after mc resources are loaded (unless in
-
Activation
- When
VR_INITIALIZED == trueand HMD has been put on, setVR_ACTIVE = true. - If HMD has been taken off while on server not supporting vanilla, the VR_ACTIVE stays true
- If in VR_WORLD_ONLY play mode, set
VR_ACTIVE = trueonly in world
- When
-
Focus
- While
VR_ACTIVE == true, monitor for system/menu overlays. - If the user opens any non-game UI (pause menu, Steam overlay, etc.), set
VR_FOCUSED = false. - When the game view regains focus, set
VR_FOCUSED = true.
- While
-
If VR has thrown an error
- If the player is in-world, leaves it
- VR session is destroyed, set
VR_INITIALIZED = false - VR Play Mode changes to DISABLED
- Shows VR error screen