Skip to main content

Module headless

Module headless 

Source
Expand description

The headless run: the whole scene, stepped inline without a window, threads or audio output.

The windowed mode spreads the worlds across threads: a render sub-world on the main thread, remote physics, audio and gameplay worlds on their own threads. The headless run keeps the same worlds and the same job and snapshot plumbing, but every world lives in one place and the run drives them in a fixed order: gameplay ticks, physics drains its jobs and steps, the synthesizer renders the tracks, then the render world drains its commands and draws. With every world stepped at a fixed rate, a run is reproducible down to the captured frames and audio samples.

Re-exportsΒ§

use std::sync::Arc; πŸ”’
use unlit_wgpu::readback::readback_texture; πŸ”’
use unlit3d::frame::Frame; πŸ”’
use unlit3d::frame::dispatch_frame; πŸ”’
use crate::scene::AudioSetup; πŸ”’
use crate::scene::HEADLESS_HZ; πŸ”’
use crate::scene::PanelSlots; πŸ”’
use crate::scene::SceneStepper; πŸ”’
use crate::scene::mount_scene_content; πŸ”’
use crate::scene::setup_render_world; πŸ”’
use crate::scene::spawn_scene; πŸ”’
use unlit3d::prelude::*; πŸ”’
use unlit3dx::prelude::*; πŸ”’

StructsΒ§

HeadlessConfig
The headless run’s settings.
HeadlessOutput
What one headless run produced.

ConstantsΒ§

AUDIO_CHANNELS
How many channels the headless run mixes: the interleaved samples the audio world’s fill dispatch writes, and the stream the encoder reads.
AUDIO_SAMPLE_RATE
The audio sample rate the headless run renders at, in hertz.

FunctionsΒ§

run
Run the scene headless and answer the captured frames and audio.