Byte Engine Docs
View on docs.rs

graphics

Generated Rust API reference for byte_engine.

byte_engine / application / graphics


Module graphics

Headed application runtime and graphics setup entry points.

Construct GraphicsApplication, configure it with either default_setup or selected setup functions, then run its loop. The triangle example uses the complete default stack; the window example creates only a window.

Rendering setup remains in this module because it coordinates the world, renderer, and application factories. General startup defaults and external adapters are kept behind the setup functions re-exported from this module.

Follow the sample project guide for the complete application setup sequence.

Contents

Quick Reference

Modules

  • defaults — Conventional setup components for [GraphicsApplication].

Structs

GraphicsApplication

struct GraphicsApplication {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/application/graphics/mod.rs:59-143

The GraphicsApplication struct owns the headed runtime and coordinates windows, input, worlds, resources, audio workers, and rendering.

Use default_setup for the conventional engine stack. Use setup_default_window, setup_default_input, and the render-pass setup functions independently when an application needs explicit composition. After setup, call Self::do_loop to run the application, or Self::tick_with when application code must run during each tick. Call Self::run_lanes from it when part of that code should run on every lane of the application's alley.

Configuration

  • kill-after: Closes the application after this number of ticks. The default is None.
  • inspector.port: Serves the HTTP inspector on this loopback port. The default is 6680, or a free port the system picks, logged as a warning, when another application uses it. A port set here that is in use stops startup.
  • metrics-out: Writes the performance metrics the inspector serves to this file when the application closes: the GET /metrics summary as JSON, or every retained tick as NDJSON, one GET /metrics/frames row per line, when the path ends in .ndjson. Combine it with kill-after to measure a run without polling. The default is None.
  • debug.streams: Writes every entity data stream that world-spawned DebugDataStream requests to log, stdout, stderr, or the file at this path, such as /dev/fd/3, as NDJSON. The default is None, which opens no stream.
  • debug.streams.changes-only: Writes a data stream record only when the system's key for it changed, leaving out records where only progress like a phase moved. The default is false.
  • max-frame-rate: Caps presentation at this many frames per second; frames land on even refreshes. The default is uncapped.
  • simulation-rate: Steps simulation this many times per second, independent of how often frames are presented. Self::tick_stepped_with paces its steps on it and defaults to 60. Self::tick_with simulates once per frame and panics when this rate disagrees with the rate frames are presented at.
  • render-on-demand: Renders only when something changed instead of on every tick. Window changes, UI renders, and screenshot requests ask for frames; call Renderer::request_redraw after changing the scene. Idle ticks keep running at the refresh rate of the fastest display showing a window, or the max-frame-rate pace when that is slower, so events are still handled. Once the frame is shown and no UI component waits for a frame, the loop waits in the window system until an event, a UI timer, or a crate::application::LoopWaker wakes it; call crate::application::LoopWaker::wake from threads that change state the loop must see. The default is false.
  • assets-path: Selects the debug-build asset directory. Relative overrides use the current working directory. In development, the default is assets under CARGO_MANIFEST_DIR when available, then beside the executable.
  • resources.path: Selects the resource directory. Relative overrides use the current working directory. In development, the default uses CARGO_MANIFEST_DIR when available; otherwise, it is beside the executable.
  • render.debug: Enables validation layers. The default is true in debug builds.
  • render.debug.dump: Enables graphics API logging. The default is false.
  • render.debug.extended: Enables extended validation. The default is false.
  • render.pipeline-cache.path: Keeps compiled pipelines in this file, so later runs create their pipelines without compiling shaders. The file is read at startup, and the pipelines compiled since are appended to it when the application closes; a run that compiles none does not touch it. Use one file per GPU when applications that run on different GPUs at the same time would otherwise share it. Data from another GPU or driver version is ignored. Relative paths use the current working directory. The default is none, which leaves pipeline caching to the GPU driver.
  • messages.capacity: Sets the bytes of message storage shared by every typed route, in whole chunks of crate::core::message_bus::CHUNK_BYTES. A publisher waits when every chunk is held by unread messages. The default is 67108864, which is 64 MiB.
  • render.pass.<name>: Selects enabled or bypassed for the named render pass.
  • render.debug.view.<pass>.<view>: Shows (true) or hides (false) one debug view of the named render pass or scene pipeline manager, such as render.debug.view.motion-blur.velocity. Shown views tile over the presented image, each in one of render.debug.targets slots; a view is refused when every slot is taken. GET /debug-views on the inspector lists the views. The default is hidden.
  • render.debug.targets: Sets how many debug views can be shown at once, from 1 to 15. The default is 4.
  • render.debug-views.enabled: Builds debug views into the project. Like render.gtao.enabled, the startup value decides whether their code is baked into the shaders; a build without them refuses every render.debug.view.*. The default is true in debug builds and false in release builds.
  • render.gtao.enabled: Runs GTAO, which darkens environment light in creases and corners. Both screen-space occlusion sources can run alone, together, or not at all; together, each pixel takes the stronger occlusion. The startup value also decides whether GTAO is built in: set it to false in config.json and BELD bakes shaders without GTAO code and skips its pipelines, and GTAO cannot be turned on at runtime. See crate::rendering::pipelines::visibility::VisibilityFeatures. The default is true.
  • render.gtao.radius: Sets the GTAO world-space search radius. The default is 1.0.
  • render.gtao.samples-per-ray: Sets the GTAO samples along each ray. The default is 4.
  • render.gtao.radial-rays: Sets the even number of GTAO ray directions. The default is 6.
  • render.ssgi.enabled: Runs screen-space global illumination, which adds light bounced off visible surfaces and darkens environment light that nearby geometry blocks. Like render.gtao.enabled, its startup value also decides whether SSGI is built into the baked shaders. The default is true.
  • render.contact-shadows.enabled: Traces short rays toward the sun to shadow where objects touch, such as under a foot on a floor. Like render.gtao.enabled, its startup value also decides whether contact shadows are built into the baked shaders. The default is true.
  • render.contact-shadows.distance: Sets the world-space reach of each contact-shadow ray. The default is 0.15.
  • render.lod.bias: Scales the on-screen error, one pixel by default, that a mesh detail level may show before a finer one is drawn. Values above 1 draw coarser levels sooner, and 0 allows no error. Levels follow the first window's camera, and shadows draw the same level. The default is 1.0.
  • render.lod.force: Draws this detail level for every mesh instead of choosing by distance, where 0 is full detail; a mesh with fewer levels draws its coarsest one. Use it to compare levels or to measure what they save. The default is off.
  • render.shadow-maps.budget-mb: Sets the shadow-map memory, in mebibytes, that every shadow-casting light shares. The first directional light takes its cascades first, cone and point lights then share what remains by how much of the screen they light, and other directional lights take what is left. One sun takes 32 MiB at the default resolution and four times that per doubling of render.directional-shadows.resolution; a cone light takes 32 KiB to 8 MiB and a point light 192 KiB to 48 MiB, by how large it looks in the largest sink that sees it. Maps allocate on first use; the default is 128.
  • render.shadow-maps.update-texels: Sets how many shadow-map texels each frame draws. Cascades 0 and 1 of every shadowed sun draw every frame and count first; the other cascades, cone maps, and point cube faces then draw by need within what's left, so a smaller budget spreads their updates over more frames. The default is 16777216, the four cascades of one sun at 2,048 texels per side.
  • render.directional-shadows.resolution: Sets the directional shadow cascades' resolution in texels per side, a multiple of 16. Halving it quarters the shadow raster and depth pyramid work, and each sun's cost from the shadow-map budget. The default is 2048.

See the sample project guide for a complete GraphicsApplication setup.

Implementations

  • fn new(name: &str, parameters: &[Parameter]) -> Self

    Related: Parameter

    Creates the headed runtime with the specified name and configuration parameters.

    Parameters may be overridden by the project's config.json, then by BE_* environment variables, and then by

    --name=value command-line arguments. The pipeline compilation servers start here, so every setup function can

    request pipelines.

    Next, call default_setup or the individual setup functions, then Self::do_loop.

  • fn get_name(&self) -> &str

    Returns the name the application was created with.

  • fn tick(&mut self) -> bool

    Runs one graphics tick without application code and returns whether the application keeps running.

  • fn frame_allocator(&self) -> &bumpalo::Bump

    Returns frame-local storage for temporary allocations during the current tick.

  • fn simulation_alpha(&self) -> f32

    Returns how far the frame about to be drawn lies between the two most recent simulation steps, from 0 to 1.

    Renderers show step state blended by this amount, so frame code that places anything over the scene, such

    as UI that follows an entity, blends the same way to keep pace with what they draw.

  • fn configuration(&self) -> &Configuration

    Related: Configuration

    Returns the configuration exchange used to inspect startup update results.

  • fn tick_with<R, F: FnOnce(&mut Self, Time) -> R>(&mut self, f: F) -> Option<R>

    Runs one graphics tick and lets application code update state before rendering.

    Simulation advances once per tick, by the frame delta. A simulation-rate that disagrees with the rate

    frames are presented at panics here; use Self::tick_stepped_with to run the two rates apart.

  • fn runtime(&mut self) -> &mut crate::gameplay::Runtime

    Related: Runtime

    Returns the gameplay task runtime owned by the application.

    Spawn behaviors through Runtime::spawn, then call

    Runtime::poll before and after the systems whose messages tasks

    await. The application advances task time before each Self::tick_with callback or each simulation

    callback of Self::tick_stepped_with.

  • fn run_lanes<L>(&mut self, lanes: L)

    Runs lanes once on every lane of the application's alley, from a tick callback, and returns when every

    lane has finished.

    lanes receives each lane's ConcreteLane, the context for lane

    indices, single-runner sections, and collectives such as

    ConcreteLane::each_shared. What the lanes publish,

    such as created bodies and their transforms, is complete when this returns, so a system stepped after it,

    such as Physics::step, sees it whole instead of racing it. A lane panic

    resumes here.

    The lanes cannot borrow the application; take the handles they publish through beforehand, such as

    MessageScope::factory, and share other state through Sync values. Executions cannot nest: calling

    this from a lane, or while Self::alley_mut is borrowed, panics.

  • fn tick_stepped_with<R, S: FnMut(&mut Self, Time), F: FnOnce(&mut Self, Time) -> R>(&mut self, simulate: S, frame: F) -> Option<R>

    Runs one graphics tick whose simulation advances in fixed steps, independent of the frame rate.

    simulate runs zero or more times before the frame, each time with a Time whose delta is the fixed

    step from simulation-rate and whose elapsed value counts the steps run so far. Step the systems that

    simulate, such as Physics::step, from it. frame then runs once with

    the frame's own display-derived Time, for the work that belongs to what is about to be drawn: the UI,

    cameras, and animation.

    A frame that owes more steps than the loop runs in one tick drops the outstanding time instead of running

    it later. Renderers consume the state left by the last step, so a simulation rate below the frame rate

    repeats a frame's worth of state until the next step lands.

  • fn close(&mut self)

    Flags the application for closing.

  • fn waker(&self) -> LoopWaker

    Related: LoopWaker

    Returns a waker that makes this application run its next tick from any thread.

    Hand it to whatever changes state the loop cannot observe through window events, such as a worker thread or

    a UI engine through Engine::set_waker. It only matters with render-on-demand, where an idle loop waits

    in the window system.

  • fn schedule_tick(&mut self, at: Option<std::time::Instant>)

    Asks the loop to run a tick at at, or as soon as it can when at has passed.

    Systems the loop drives itself, such as a UI engine, report their next evaluation this way: pass

    Engine::next_tick from the tick callback. Without a request, an idle render-on-demand loop waits for

    events and wakes. The earliest request wins, and each tick starts without one.

  • fn alley_mut(&mut self) -> &mut crate::core::alley::Alley

    Borrows the persistent lanes for independent application or frame work.

    Use crate::core::alley::Alley::join for caller-bound work or

    crate::core::alley::Alley::execute_with_mut for resources with stable lane ownership.

    Every dispatch finishes before returning to the application's next phase.

    Systems that step on the lanes, such as Physics::step, take them from

    here.

  • fn input(&self) -> &input::InputCollector

    Related: InputCollector

    Returns the collector that owns the registered devices and their control values.

    Declared Action values are published through the world's

    ActionEvent channel.

  • fn renderer(&self) -> &Renderer

    Related: Renderer

    Returns the renderer used by setup functions and advanced render integrations.

  • fn renderer_mut(&mut self) -> &mut Renderer

    Related: Renderer

    Returns mutable renderer access for application-defined pipeline setup.

    Use this during startup to create renderer-owned GHI resources, such as the samplers a pipeline binds

    loaded images with. Then call Renderer::add_pipeline_manager before the application starts rendering.

    For asynchronous loading, create lanes from Self::loader_mut.

  • fn loader_mut(&mut self) -> &mut rendering::loading::Loader

    Related: Loader

    Returns the loader that uploads resources for every pipeline, creating it on first use.

    Create a pipeline's lanes with rendering::loading::spawn during setup. The loader then starts on the

    loading thread with defaults::launch_deferred_tasks_thread.

    Panics

    Panics after the loading thread started, because a lane created then would never be served.

  • fn add_deferred_task(&mut self, task: impl FnOnce(&compio::runtime::Runtime) + Send + 'static)

    Queues loading work that spawns its futures on the loading thread's runtime.

    Tasks run in the order they were added, after the loader starts, once

    defaults::launch_deferred_tasks_thread moves them to the loading thread.

    Panics

    Panics after the loading thread started, because a task added then would never run.

  • fn window_factory(&self) -> &Factory<Window>

    Related: Window

    Returns the factory used to request new windows.

  • fn messages(&self) -> &MessageScope

    Related: MessageScope

    Returns the application-owned namespace used by headed-runtime channels and factories.

    Next, call MessageScope::channel or MessageScope::factory to add an

    application-defined message route without declaring its type at startup.

    Subscribe to ghi::window::Event before creating windows to handle raw

    input in your application callback. Events are published in arrival order,

    and each window event carries the ghi::window::WindowId it targets.

  • fn message_bus(&self) -> &MessageBus

    Related: MessageBus

    Returns the shared fixed-storage message bus for diagnostics and new scopes.

    Next, call MessageBus::topics to inspect registered routes or

    MessageBus::new_scope to isolate routes owned by another subsystem.

  • fn parameters(&self) -> &[Parameter]

    Related: Parameter

    Returns the resolved startup parameters.

    Next, hand a system its subtree with Parameters::scope, such as

    app.parameters().scope("physics") for Physics::new.

  • fn world(&self) -> &MessageScope

    Related: MessageScope

    Returns the world scope, where application code creates entities and the systems that follow them.

    Next, create entities with Creator::create and the systems the application needs on it, such as

    SceneGraph::new and Physics::new,

    and step them from the tick callback in the order the application wants. The scope is Clone, so lanes

    and systems keep their own copy.

  • fn generator_factory(&self) -> &Factory<std::boxed::Box<dyn Generator>>

    Related: Generator

    Returns the audio generator factory used by default audio setup.

  • fn do_loop(&mut self)

    Runs ticks until the application is closed.

  • fn resource_manager(&self) -> &ResourceManager

    Returns the resource manager shared by rendering and asset setup.

  • fn resource_manager_handle(&self) -> EntityHandle<ResourceManager>

    Related: EntityHandle

    Returns shared ownership of the resource manager for application-owned async systems.

    Use this handle when constructing loaders such as

    crate::animation::graph::AnimationPool. Next, spawn the returned

    worker on the application's chosen async runtime.

Trait Implementations

impl ArchivePointee for GraphicsApplication
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for GraphicsApplication
impl Downcast for GraphicsApplication
  • fn into_any(self: Box<T>) -> Box<dyn Any>
  • fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
  • fn as_any(&self) -> &dyn Any
  • fn as_any_mut(&mut self) -> &mut dyn Any
impl Drop for GraphicsApplication
  • fn drop(&mut self)
impl Instrument for GraphicsApplication
impl LayoutRaw for GraphicsApplication
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for GraphicsApplication
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for GraphicsApplication
  • type Metadata = ()
impl Read for GraphicsApplication
impl WithSubscriber for GraphicsApplication

Functions

setup_aces_color_grading_render_pass

fn setup_aces_color_grading_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:468-473

Installs a fused ACEScg/ACEScct grading and SDR output pass from a prepared LUT.

The LUT must accept and return ACEScct values. The pass uses an AP1-aware fitted SDR transform; it does not claim ACES reference-transform compliance. Load it with crate::rendering::render_passes::lut::PreparedLut::load on application-owned asynchronous work before calling this setup function. Call this after scene-linear effects. Later passes consume its remapped main output.

setup_aces_tonemap_render_pass

fn setup_aces_tonemap_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:387-389

Installs the ACES v1 tonemapping pass for post-scene color mapping.

Register it before creating a window; use render.pass.aces to enable or bypass it at runtime.

setup_agx_tonemap_render_pass

fn setup_agx_tonemap_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:370-372

Installs the AGX tonemapping pass for post-scene color mapping.

Register it before creating a window; use render.pass.agx to enable or bypass it at runtime.

setup_atmosphere_sky_render_pass

fn setup_atmosphere_sky_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:563-577

Installs the atmosphere sky as every sink's scene background.

Scene pipelines draw it after opaque surfaces and before transparent ones, so transparent surfaces blend over the sky. Use render.pass.atmosphere sky to enable or bypass it at runtime; bypassed, the background is black.

The newest DirectionalLight is the sky's sun: its illuminance sets the sky's brightness and color, and its transform sets the sun's direction. Without one, the sky stays black.

Each window's sky subscribes to lights when the renderer adopts the window, at the end of the tick that creates it, and doesn't see lights created before then. Create the window in one tick and the light in a later one.

setup_bloom_render_pass

fn setup_bloom_render_pass(application: &mut GraphicsApplication, settings: crate::rendering::render_passes::bloom::BloomPassSettings)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:410-416

Installs an HDR bloom pass for every current and future render sink.

The pass glows scene-linear light above settings.threshold and adds it back onto main, so call it after the passes that write scene light, such as the visibility pipeline and the atmosphere sky, and before tone mapping. Later passes consume its remapped main output. Use render.pass.bloom to enable or bypass it at runtime.

setup_debug_mesh_render_pass

fn setup_debug_mesh_render_pass(application: &mut GraphicsApplication) -> crate::core::factory::Factory<rendering::DebugMesh>

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:16-37

Installs the retained wireframe debug scene after the render passes registered before this call.

Call this after tone mapping, every other image effect, and any overlay it should cover to keep debug colors unchanged and on top. The pass also supports registration before tone mapping when post-processed, scene-linear debug colors are useful. In either position, depth-aware messages read the scene pipeline's depth image without modifying it. Register this pass before creating the first window. Next, call Factory::create once for each rendering::DebugMesh, Factory::derive to replace it, and a DeleteMessage on the world scope to remove it.

setup_dwg_color_grading_render_pass

fn setup_dwg_color_grading_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:483-488

Installs a fused DaVinci Wide Gamut/Intermediate grading and SDR output pass from a prepared LUT.

The LUT must accept and return DaVinci Wide Gamut/Intermediate values. The pass uses AgX for SDR display rendering and does not claim parity with DaVinci Resolve color management. Load it with crate::rendering::render_passes::lut::PreparedLut::load on application-owned asynchronous work before calling this setup function. Call this after scene-linear effects. Later passes consume its remapped main output.

setup_exponential_height_fog_render_pass

fn setup_exponential_height_fog_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:535-551

Installs exponential height fog for every current and future render sink.

The fog hides distant surfaces and the horizon behind mist that thins with altitude, lit by the sky and the newest DirectionalLight. Call it after the scene pipeline and setup_particles, and before setup_lens_flare_render_pass, setup_bloom_render_pass, and tone mapping, so bright light glows through the fog. Use render.pass.exponential-height-fog to enable or bypass it at runtime.

The pass draws nothing until a fog exists. Next, create an rendering::ExponentialHeightFog through MessageScope::factory. Like the atmosphere sky, each window's fog subscribes to fogs and lights when the renderer adopts the window, so create them in a tick after the one that creates the window.

setup_lens_flare_render_pass

fn setup_lens_flare_render_pass(application: &mut GraphicsApplication, settings: rendering::render_passes::lens_flare::LensFlarePassSettings)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:447-459

Installs a screen-space lens flare pass for every current and future render sink.

The pass casts tinted ghosts and a halo from scene-linear light above settings.threshold and adds them onto main. Call it after the passes that write scene light and before setup_bloom_render_pass and tone mapping, so the ghosts glow with the rest of the scene. Later passes consume its remapped main output. Use render.pass.lens-flare to enable or bypass it at runtime.

setup_lut_render_pass

fn setup_lut_render_pass(application: &mut GraphicsApplication, lut: crate::rendering::render_passes::lut::PreparedLut)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:497-499

Installs a 3D LUT grading pass from asynchronously prepared resource data.

Load the resource once with crate::rendering::render_passes::lut::PreparedLut::load on application-owned asynchronous work. Each sink receives its own copy of the bytes, which its pass drops after the first upload. Call this after passes that produce the HDR main target and before tone mapping.

setup_motion_blur_render_pass

fn setup_motion_blur_render_pass(application: &mut GraphicsApplication, settings: rendering::render_passes::motion_blur::MotionBlurPassSettings)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:426-438

Installs camera motion blur for every current and future render sink.

The pass smears main along the camera's turn and zoom since the previous frame, for the fraction of the frame settings.shutter stays open. Camera translation and moving objects do not blur. Call it after the passes that write scene light and setup_exponential_height_fog_render_pass, and before setup_lens_flare_render_pass, setup_bloom_render_pass, and tone mapping, so light glows over the blurred image. Later passes consume its remapped main output. Use render.pass.motion-blur to enable or bypass it at runtime, and render.motion-blur.taps to change the most taps per pixel; both also take a startup parameter.

setup_particles

fn setup_particles(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:150-160

Installs the GPU particle runtime on top of the scene pipeline registered before it.

Call this after the scene pipeline setup, such as setup_pbr_visibility_shading_render_pipeline, and before defaults::launch_deferred_tasks_thread, which runs the lane that loads particle systems. Particles add their light to the scene's main color before post-processing, so bloom and tone mapping treat them like any other emitter. A system costs nothing on frames without live particles.

Next, create a rendering::ParticleEmitter naming a .particles asset, with a crate::gameplay::Transform, through Creator::create on the world scope.

setup_pbr_visibility_shading_render_pipeline

fn setup_pbr_visibility_shading_render_pipeline(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:94-139

Installs the visibility-buffer PBR scene pipeline and its loader lanes.

Visibility loads meshes, materials, and textures through one lane pool. A mesh load requests its materials as soon as it reads their names, and a material load requests its textures the same way, so all three load at once. Mesh loads append parallel geometry streams, material loads assign table slots, and texture loads finish CPU or native GPU-I/O uploads before publishing residency. These choices belong to Visibility; they are not requirements of the shared loader.

Every loader lane runs on the loading thread, which defaults::launch_deferred_tasks_thread starts together with the application's Loader.

Next, create an Environment through MessageScope::factory to select the HDR image used for ambient and specular reflections.

setup_simple_render_pipeline

fn setup_simple_render_pipeline(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:51-75

Installs the simple scene pipeline and registers its asynchronous mesh-loading worker.

This setup is the smallest end-to-end implementation of rendering::loading. It creates one loader lane and a Simple-owned store whose position and index streams intentionally differ from Visibility storage. The application's Loader uploads the lane's meshes. Simple's shaders use the renderer's asynchronous pipeline compilation servers; this setup never waits for shader resources.

The lane runs on the loading thread, so start that thread with defaults::launch_deferred_tasks_thread after every subsystem has registered its work. That thread also runs the loader.

setup_smaa_render_pass

fn setup_smaa_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:519-523

Installs spatial SMAA for every current and future render sink.

This adds a self-contained post-scene pass without coalescing it with tone mapping or other independent passes. Call it after the setup that produces the main color input you want SMAA to filter, and before any overlay pass you want to keep sharp.

setup_srgb_display_render_pass

fn setup_srgb_display_render_pass(application: &mut GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:380-382

Installs display sRGB encoding without applying a tone-mapping curve.

Use this as the final post-scene pass for SDR scenes whose colors already fit in the display range. Omit this setup when a tone mapper or color-grading pass already produces display-encoded output. Register it before creating a window; use render.pass.srgb-display to enable or bypass it at runtime.

setup_ui_render_pass

fn setup_ui_render_pass(application: &mut GraphicsApplication, ui: &crate::core::factory::Factory<crate::ui::layout::engine::Render>, font: Option<&std::path::Path>)

Defined in crates/byte-engine/src/application/graphics/pipeline.rs:176-239

Installs the retained UI render pass fed by UI render messages from ui.

Register this pass before publishing renders that every sink must observe. The source subscribes immediately and retains the latest render for sinks initialized later. font is the file text is drawn with, or None for a system font; pass the same file to crate::ui::Engine::with_font so layout and drawing agree.

default_image_processor

fn default_image_processor() -> resource_management::processors::image::ImageProcessor

Defined in crates/byte-engine/src/application/graphics/defaults.rs:168-186

Returns an image processor with GPU mip and environment-map generators, falling back to CPU generation for each one whose GPU setup fails.

Install it with AssetManager::set_image_processor.

default_setup

fn default_setup(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:14-33

Installs the standard assets, input devices, audio worker, visibility rendering pipeline, and window.

After setup, create application actions and select scene lighting through GraphicsApplication::world, then run the application with GraphicsApplication::do_loop.

register_default_asset_handlers

fn register_default_asset_handlers(asset_manager: &mut resource_management::asset::manager::AssetManager, generator: impl ProgramGenerator + Clone + 'static, features: crate::rendering::pipelines::visibility::VisibilityFeatures)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:130-162

Registers the standard material, model, image, audio, and standalone-shader handlers on asset_manager.

The debug runtime and BELD both call this, so a baked store and a debug run produce the same resources from the same assets. generator adapts generated material shaders to the renderer, and features removes left-out features from standalone shaders. Every handler that produces images bakes them through the manager's image processor; install default_image_processor with AssetManager::set_image_processor to use the GPU backends.

setup_animation_pool

fn setup_animation_pool(application: &mut super::GraphicsApplication, byte_budget: std::num::NonZeroUsize) -> crate::animation::graph::AnimationPool

Defined in crates/byte-engine/src/application/graphics/defaults.rs:308-318

Creates an AnimationPool with the given decoded-clip byte budget and queues its load worker on the application's loading thread.

Next, call AnimationPool::update once per tick before advancing graph players that share the pool, then create animation graphs through crate::animation::graph::AnimationGraphPlayer.

setup_animation_system

fn setup_animation_system(application: &mut super::GraphicsApplication) -> crate::animation::system::AnimationSystem

Defined in crates/byte-engine/src/application/graphics/defaults.rs:286-300

Creates the world's animation system from the application's animation parameters.

Call before starting the loading thread and creating animators. Next, register graphs with AnimationSystem::register and step the system each frame.

setup_default_audio

fn setup_default_audio(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:211-280

Starts the audio worker, its byte-bounded global sample pool, and the standard audio entity listeners.

Next, submit a crate::audio::generator::Generator through GraphicsApplication::generator_factory to make it available to the audio worker, or create an crate::audio::graph::AudioGraph through crate::audio::graph::AudioGraphFactory.

setup_default_input

fn setup_default_input(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:193-202

Installs the device classes expected by super::process_default_window_input.

Next, create application-level actions through GraphicsApplication::world. The application tick translates window events and emits their resolved action values.

setup_default_resource_and_asset_management

fn setup_default_resource_and_asset_management(application: &mut super::GraphicsApplication, generator: impl ProgramGenerator + Clone + 'static)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:101-122

In debug builds, connects the asset directory and standard material, model, image, audio, and standalone-shader handlers to the resource manager.

Release builds intentionally leave the manager without asset processors and must receive their complete resource store from BELD.

setup_default_window

fn setup_default_window(application: &mut super::GraphicsApplication)

Defined in crates/byte-engine/src/application/graphics/defaults.rs:88-93

Creates the 1920x1080 window used by the default headed setup.

process_default_window_input

fn process_default_window_input<A: std::alloc::Allocator + Clone>(collector: &mut input::InputCollector<A>, event: ghi::window::Events) -> bool

Defined in crates/byte-engine/src/application/graphics/integrations.rs:109-129

Records a GHI window event into the standard mouse and keyboard devices.

Focus loss, minimizing, closing, and resizing interrupt the interaction, so the seat's queued and retained records are discarded and the function returns true. Cancel your sinks' held actions when it does.

setup_default_dmx

fn setup_default_dmx(application: &mut super::GraphicsApplication, receiver: crate::core::listener::DefaultListener<utils::RGBA>)

Defined in crates/byte-engine/src/application/graphics/integrations.rs:30-85

Starts an Art-Net worker that publishes received RGBA values as DMX output.

On this page