# tb0ne/nightfall architecture

> Architecture diagram of the GitHub repository tb0ne/nightfall, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tb0ne/nightfall
- Repository: https://github.com/tb0ne/nightfall

## Overview

Nightfall is a VR streaming suite: the headset client discovers or pairs with a PC host, configures a stream, receives media, and presents it as adjustable VR screens. Optional Meteor adds managed hosting, PCVR, host-side depth inference, and microphone passthrough. The graph preserves browser, USB, passthrough, and depth capabilities alongside the main stream flow. Relationships among unsampled subsystems are documented-level links, not claims of inspected call paths; source excerpts and the index confirm selected implementations and imports.

Main entry points: [`addons/nightfall-stream/src/nightfall_stream.cpp`](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/nightfall_stream.cpp) (VR client), [`meteor/src/main.rs`](https://github.com/tb0ne/nightfall/blob/main/meteor/src/main.rs) (Meteor companion), [`addons/nightfall-stream/src/video/stream_connection.cpp`](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/stream_connection.cpp) (Video decoding), [`meteor/src/depth.rs`](https://github.com/tb0ne/nightfall/blob/main/meteor/src/depth.rs) (Host depth inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Headset client"]
  node_client_app["VR client"]
  node_discovery_pairing["Discovery and pairing"]
  node_client_settings[("Host and stream settings<br/>[config_manager.cpp]")]
  node_browser["Browser features"]
  node_adblock["Optional ad blocking<br/>[lib.rs]"]
end

subgraph group_stream["Streaming and media"]
  node_stream_control["Stream control"]
  node_host_services["Compatible PC host"]
  node_video_decode["Video decoding"]
  node_pyrowave["PyroWave GPU decode"]
  node_audio["Audio playback<br/>[audio_renderer.cpp]"]
  node_input["Controller and keyboard input<br/>[input_bridge.cpp]"]
  node_usb["USB Link"]
end

subgraph group_meteor["Meteor host"]
  node_meteor_app["Meteor companion<br/>[main.rs]"]
  node_meteor_config[("Meteor configuration<br/>[config.rs]")]
  node_managed_host["Managed host<br/>[mod.rs]"]
  node_host_pairing["Host setup and pairing<br/>[pairing.rs]"]
  node_mic["Microphone passthrough<br/>[mic.rs]"]
end

subgraph group_depth["Depth processing"]
  node_depth_ingest["Video depth feed<br/>[depth.rs]"]
  node_host_depth["Host depth inference<br/>[depth.rs]"]
  node_depth_models["Inference backends<br/>[vda.rs]"]
  node_depth_refinement["Depth postprocessing<br/>[gpu_post.rs]"]
  node_local_depth["On-headset depth"]
end

subgraph group_xr["PCVR and XR"]
  node_pcvr_client["PCVR client extension"]
  node_xr_relay["XR relay<br/>[xr_relay.rs]"]
  node_xr_session["XR session adapter"]
end

node_user(("Headset user"))

node_user -->|"operates"| node_client_app
node_client_app -.->|"selects host"| node_discovery_pairing
node_discovery_pairing -->|"updates hosts"| node_client_settings
node_client_app -.->|"opens pages"| node_browser
node_browser -.->|"optionally filters"| node_adblock
node_client_app -->|"configures stream"| node_stream_control
node_stream_control -->|"requests stream"| node_host_services
node_host_services -->|"sends video"| node_video_decode
node_video_decode -.->|"decodes PyroWave"| node_pyrowave
node_video_decode -.->|"renders screens"| node_client_app
node_host_services -.->|"sends audio"| node_audio
node_client_app -.->|"forwards controls"| node_input
node_client_app -->|"uses USB Link"| node_usb
node_client_app -->|"runs local depth"| node_local_depth
node_client_app -->|"discovers companion"| node_meteor_app
node_meteor_app -->|"loads settings"| node_meteor_config
node_meteor_app -->|"offers managed host"| node_managed_host
node_meteor_app -->|"supports PIN approval"| node_host_pairing
node_meteor_app -->|"provides microphone"| node_mic
node_meteor_app -->|"starts depth service"| node_depth_ingest
node_depth_ingest -->|"feeds frames"| node_host_depth
node_host_depth -->|"runs inference"| node_depth_models
node_host_depth -->|"postprocesses maps"| node_depth_refinement
node_depth_refinement -->|"sends depth maps"| node_client_app
node_client_app -->|"launches PCVR"| node_pcvr_client
node_meteor_app -.->|"provides XR relay"| node_xr_relay
node_xr_session -->|"manages session"| node_xr_relay

click node_client_app "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/nightfall_stream.cpp"
click node_discovery_pairing "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/computer_manager.cpp"
click node_client_settings "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/config_manager.cpp"
click node_browser "https://github.com/tb0ne/nightfall/blob/main/android/src/main/java/com/godot/game/BrowserNavigation.java"
click node_adblock "https://github.com/tb0ne/nightfall/blob/main/extensions/browser-adblock/src/lib.rs"
click node_stream_control "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/computer_manager.cpp"
click node_video_decode "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/stream_connection.cpp"
click node_pyrowave "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/pyrowave_gpu_pipeline.cpp"
click node_audio "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/audio/audio_renderer.cpp"
click node_input "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/input/input_bridge.cpp"
click node_usb "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/network/usb_link_bridge.cpp"
click node_meteor_app "https://github.com/tb0ne/nightfall/blob/main/meteor/src/main.rs"
click node_meteor_config "https://github.com/tb0ne/nightfall/blob/main/meteor/src/config.rs"
click node_managed_host "https://github.com/tb0ne/nightfall/blob/main/meteor/src/host/mod.rs"
click node_host_pairing "https://github.com/tb0ne/nightfall/blob/main/meteor/src/host/pairing.rs"
click node_mic "https://github.com/tb0ne/nightfall/blob/main/meteor/src/mic.rs"
click node_depth_ingest "https://github.com/tb0ne/nightfall/blob/main/meteor/src/depth.rs"
click node_host_depth "https://github.com/tb0ne/nightfall/blob/main/meteor/src/depth.rs"
click node_depth_models "https://github.com/tb0ne/nightfall/blob/main/meteor/src/vda.rs"
click node_depth_refinement "https://github.com/tb0ne/nightfall/blob/main/meteor/src/gpu_post.rs"
click node_local_depth "https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/midas_depth_engine.cpp"
click node_pcvr_client "https://github.com/tb0ne/nightfall/blob/main/extensions/nightfall-xr/src/pcvr_alvr_client.cpp"
click node_xr_relay "https://github.com/tb0ne/nightfall/blob/main/meteor/src/xr_relay.rs"
click node_xr_session "https://github.com/tb0ne/nightfall/blob/main/meteor/src/xr_session_windows.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client_app,node_discovery_pairing,node_client_settings,node_browser,node_adblock,node_user toneBlue
class node_stream_control,node_host_services,node_video_decode,node_pyrowave,node_audio,node_input,node_usb toneAmber
class node_meteor_app,node_meteor_config,node_managed_host,node_host_pairing,node_mic toneMint
class node_depth_ingest,node_host_depth,node_depth_models,node_depth_refinement,node_local_depth toneRose
class node_pcvr_client,node_xr_relay,node_xr_session toneIndigo
```

## Components

### Headset client

- [VR client](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/nightfall_stream.cpp): `addons/nightfall-stream/src/nightfall_stream.cpp`
- [Discovery and pairing](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/computer_manager.cpp): `addons/nightfall-stream/src/config/computer_manager.cpp`
- [Host and stream settings](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/config_manager.cpp): `addons/nightfall-stream/src/config/config_manager.cpp`
- [Browser features](https://github.com/tb0ne/nightfall/blob/main/android/src/main/java/com/godot/game/BrowserNavigation.java): `android/src/main/java/com/godot/game/BrowserNavigation.java`
- [Optional ad blocking](https://github.com/tb0ne/nightfall/blob/main/extensions/browser-adblock/src/lib.rs): `extensions/browser-adblock/src/lib.rs`

### Streaming and media

- [Stream control](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/config/computer_manager.cpp): `addons/nightfall-stream/src/config/computer_manager.cpp`
- **Compatible PC host**
- [Video decoding](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/stream_connection.cpp): `addons/nightfall-stream/src/video/stream_connection.cpp`
- [PyroWave GPU decode](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/pyrowave_gpu_pipeline.cpp): `addons/nightfall-stream/src/video/pyrowave_gpu_pipeline.cpp`
- [Audio playback](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/audio/audio_renderer.cpp): `addons/nightfall-stream/src/audio/audio_renderer.cpp`
- [Controller and keyboard input](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/input/input_bridge.cpp): `addons/nightfall-stream/src/input/input_bridge.cpp`
- [USB Link](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/network/usb_link_bridge.cpp): `addons/nightfall-stream/src/network/usb_link_bridge.cpp`

### Meteor host

- [Meteor companion](https://github.com/tb0ne/nightfall/blob/main/meteor/src/main.rs): `meteor/src/main.rs`
- [Meteor configuration](https://github.com/tb0ne/nightfall/blob/main/meteor/src/config.rs): `meteor/src/config.rs`
- [Managed host](https://github.com/tb0ne/nightfall/blob/main/meteor/src/host/mod.rs): `meteor/src/host/mod.rs`
- [Host setup and pairing](https://github.com/tb0ne/nightfall/blob/main/meteor/src/host/pairing.rs): `meteor/src/host/pairing.rs`
- [Microphone passthrough](https://github.com/tb0ne/nightfall/blob/main/meteor/src/mic.rs): `meteor/src/mic.rs`

### Depth processing

- [Video depth feed](https://github.com/tb0ne/nightfall/blob/main/meteor/src/depth.rs): `meteor/src/depth.rs`
- [Host depth inference](https://github.com/tb0ne/nightfall/blob/main/meteor/src/depth.rs): `meteor/src/depth.rs`
- [Inference backends](https://github.com/tb0ne/nightfall/blob/main/meteor/src/vda.rs): `meteor/src/vda.rs`
- [Depth postprocessing](https://github.com/tb0ne/nightfall/blob/main/meteor/src/gpu_post.rs): `meteor/src/gpu_post.rs`
- [On-headset depth](https://github.com/tb0ne/nightfall/blob/main/addons/nightfall-stream/src/video/midas_depth_engine.cpp): `addons/nightfall-stream/src/video/midas_depth_engine.cpp`

### PCVR and XR

- [PCVR client extension](https://github.com/tb0ne/nightfall/blob/main/extensions/nightfall-xr/src/pcvr_alvr_client.cpp): `extensions/nightfall-xr/src/pcvr_alvr_client.cpp`
- [XR relay](https://github.com/tb0ne/nightfall/blob/main/meteor/src/xr_relay.rs): `meteor/src/xr_relay.rs`
- [XR session adapter](https://github.com/tb0ne/nightfall/blob/main/meteor/src/xr_session_windows.rs): `meteor/src/xr_session_windows.rs`

### Other components

- **Headset user**

## Connections

- Headset user → VR client: operates (evidence: `README.md`)
- VR client → Discovery and pairing: selects host
- Discovery and pairing → Host and stream settings: updates hosts (evidence: `addons/nightfall-stream/src/config/computer_manager.cpp`)
- VR client → Browser features: opens pages
- Browser features → Optional ad blocking: optionally filters
- VR client → Stream control: configures stream
- Stream control → Compatible PC host: requests stream (evidence: `README.md`)
- Compatible PC host → Video decoding: sends video (evidence: `README.md`)
- Video decoding → PyroWave GPU decode: decodes PyroWave
- Video decoding → VR client: renders screens
- Compatible PC host → Audio playback: sends audio
- VR client → Controller and keyboard input: forwards controls
- VR client → USB Link: uses USB Link (evidence: `README.md`)
- VR client → On-headset depth: runs local depth (evidence: `README.md`)
- VR client → Meteor companion: discovers companion (evidence: `meteor/src/main.rs`)
- Meteor companion → Meteor configuration: loads settings (evidence: `meteor/src/main.rs`)
- Meteor companion → Managed host: offers managed host (evidence: `README.md`)
- Meteor companion → Host setup and pairing: supports PIN approval (evidence: `README.md`)
- Meteor companion → Microphone passthrough: provides microphone (evidence: `README.md`)
- Meteor companion → Video depth feed: starts depth service (evidence: `meteor/src/main.rs`)
- Video depth feed → Host depth inference: feeds frames (evidence: `meteor/src/depth.rs`)
- Host depth inference → Inference backends: runs inference (evidence: `meteor/src/depth.rs`)
- Host depth inference → Depth postprocessing: postprocesses maps (evidence: `meteor/src/depth.rs`)
- Depth postprocessing → VR client: sends depth maps (evidence: `README.md`)
- VR client → PCVR client extension: launches PCVR (evidence: `README.md`)
- Meteor companion → XR relay: provides XR relay
- XR session adapter → XR relay: manages session (evidence: `meteor/src/xr_session_windows.rs`)
