Skip to content

Visor lifecycle

Bogdan T. edited this page May 23, 2025 · 31 revisions

Visor Play Modes

Visor supports three play modes. Each mode controls whether the VR session is initialized and when VR is rendered, i.e. active

1. VR_DISABLED

  • Behavior
    • VR session never ininitialized
    • Can be played without VR runtime/hardware
    • Modifies only rendering of remote VR players (if connected to server supporting Visor through mod or plugin)

2. VR_ENABLED (default)

The full VR subsystem is available. 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 (unless the server disabled vanilla support).
VR_FOCUSED VR is fully functional In-game menu overlay is shown and non-essential VR visuals are disabled to save performance.

Lifecycle

  1. Initialization

    • On startup (unless in VR_DISABLED), attempt to create the XR session.
    • If successful, set VR_INITIALIZED = true.
  2. Activation

    • When VR_INITIALIZED == true and the user dons the HMD, set VR_ACTIVE = true.
    • If the HMD is removed (or the server prohibits vanilla fallback), set VR_ACTIVE = false.
  3. 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.

3. VR_WORLD_ONLY

  • Description
    The VR session is initialized at client startup, but remains inactive until the player joins a world.
  • Behavior
    • On startup, set isInitialized = true.
    • Keep isActive = false until the client enters a world/level.

Clone this wiki locally