Watch videos inside your No Man's Sky spaceship cockpit. Desktop and VR, local files and YouTube, singleplayer and multiplayer.
Hooks directly into the game's Vulkan render pipeline. Renders a textured quad in 3D space, positioned relative to the cockpit camera. Works in fullscreen and borderless modes.
Intercepts OpenVR's IVRCompositor::Submit to render per-eye stereo views. The video screen appears as a physical object in VR space with proper depth and perspective.
Load any YouTube URL directly. The daemon uses yt-dlp to extract stream URLs and decodes with ffmpeg. Hardware-accelerated via D3D11VA with automatic software fallback.
P2P synchronization via laminar. One player hosts, others auto-sync playback position with drift correction. Clock offset estimated via NTP-lite ping/pong exchanges.
Two rendering paths, each optimized for different use cases.
The injector hooks Vulkan present calls and renders a textured quad before the frame is shown. For VR, it intercepts the OpenVR compositor submit and renders per-eye with correct stereo projection.
The overlay runs as a separate transparent window on top of the game. Simpler to set up but limited to desktop borderless/windowed mode. Uses egui for interactive controls.
Four components work together, each running as a separate process.
The launcher orchestrates the entire workflow:
--disable-eac (required for injection)The daemon handles all heavy processing outside the game:
Memory budget: < 30 MB (excluding video buffer)
The injector is a Vulkan rendering hook DLL loaded into the NMS process:
vkCreateDevice, vkCreateSwapchainKHR, vkQueuePresentKHRIVRCompositor::Submit vtable entry for stereo renderingcGcCameraManager at known memory offsetsMemory budget: < 5 MB. Requires nightly Rust.
A simpler alternative for desktop-only use:
WS_EX_TRANSPARENT) with F9 toggle for interactionRequires borderless or windowed mode. Does not work in VR.
vkQueuePresentKHR hook
IVRCompositor::Submit hook
@group(0) @binding(0) var tex: texture_2d<f32>;
@group(0) @binding(1) var samp: sampler;
@fragment
fn fs_main(@location(0) uv: vec2<f32>) -> @location(0) vec4<f32> {
return textureSample(tex, samp, uv);
}
| Hook | Method | Purpose |
|---|---|---|
vkCreateInstance |
retour static_detour | Capture VkInstance for ash loader initialization |
vkCreateDevice |
retour static_detour | Capture VkDevice, VkPhysicalDevice, and queue family index |
vkCreateSwapchainKHR |
retour + ICD RawDetour | Track swapchain format, extent, and image handles |
vkQueuePresentKHR |
retour + ICD RawDetour | Render textured quad before desktop frame present |
IVRCompositor::Submit |
vtable swap | Render quad per VR eye before compositor submission |
# Launch everything (daemon + NMS + injection)
nms-video-launcher.exe
# Or start components individually:
nms-video-daemon.exe --source "https://youtube.com/watch?v=..."
nms-video-daemon.exe --source "/path/to/video.mp4"
| Key | Action |
|---|---|
F5 | Toggle video overlay on/off |
F6 | Play / Pause |
F7 | Seek backward 10 seconds |
F8 | Seek forward 10 seconds |
F9 | Load URL from clipboard |
| Key | Action |
|---|---|
F9 | Toggle interactive mode (click-through ↔ interactive) |
Space | Play / Pause |
Left / Right | Seek backward / forward |
P2P sync requires EAC to be disabled on all players. One player hosts, others auto-discover via UDP broadcast on port 7332. Playback state syncs every 500ms with drift correction.
Camera data is read from NMS memory to position the video quad in 3D space.
Singleton pointer: NMS.exe + 0x56666B0
cGcCameraManager layout:
+0x118 Camera mode (u32, cockpit = 0x10)
+0x130 View matrix (4x4 f32, row-major)
+0x1D0 FoV (f32, degrees)
+0x1D4 Aspect ratio (f32)
View Matrix Format (row-major):
[Rx Ry Rz 0] Right vector
[Ux Uy Uz 0] Up vector
[Fx Fy Fz 0] Forward vector
[Px Py Pz 1] Position
Note: Memory offsets are version-specific and may shift with NMS updates. The mem-scanner tool can re-scan for updated offsets using RTTI patterns.
cGcCameraManager class name strings, then follow vtable references to find the singleton.The mem-scanner tool (in tools/mem-scanner/) scanned 2.87 GB of NMS memory in seconds to discover these offsets.
NMS has 25 camera behaviour classes. The injector checks for cockpit mode (0x10) before rendering:
| Mode | Value | FoV | Aspect |
|---|---|---|---|
| Cockpit (ModelView) | 0x10 | 75° | 1.5 |
| On-Foot (FirstPerson) | 0x40 | 70° | 1.0 |
| Photo Mode | 0x04 | Variable | Variable |
# Clone
git clone https://github.com/AndrewAltimit/game-mods.git
cd game-mods
# Build all (release)
cargo build --release
# Build specific component
cargo build --release -p nms-video-daemon
cargo build --release -p nms-video-overlay
# Run tests
cargo test
# Format + lint
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings