Byte Engine Docs
View on docs.rs

rendering

Generated Rust API reference for byte_engine.

byte_engine / rendering


Module rendering

Rendering orchestration, scene pipelines, and composable post-processing.

renderer::Renderer owns GHI resources and executes RenderPass values for each Sink. Applications normally configure it through the setup functions in crate::application::graphics. Implement pipeline_manager::PipelineManager for scene rendering strategies and RenderPass for sink-local post-processing.

Use pipelines::simple for debugging or prototypes. The pipelines::visibility pipeline is the primary material and lighting path.

Follow Light a scene to create and submit scene lights with lux, candela, lumens, or nits.

Contents

Quick Reference

ItemKindDescription
debugmodRetained wireframe geometry for renderer and gameplay diagnostics.
devicemodThe GHI device that the rendering and loading timelines both come from.
loadingmodLoading runs on its own timeline, parallel to rendering.
particlesmodGPU-simulated particle systems.
cameramodCamera state used to derive scene views.
set_layoutmodDescriptor set layouts the renderer shares with its shaders, and name-based binding of resources to them.
render_passmodComposable sink-local rendering stages.
resource_loadingmodResource Manager to GHI utilities for loader lanes.
sinkmodPer-output render target state passed to render passes.
viewmodProjection and view matrix construction for cameras and lights.
Camerastruct
DebugMeshstruct
DebugMeshRenderPassstruct
DebugSceneManagerstruct
GraphicsDevicestruct
Environmentstruct
ExponentialHeightFogstruct
FogLayerstruct
SetMaterialParameterstruct
ParticleEmitterstruct
PipelineManagerClientstruct
PipelineManagerServerstruct
PipelineRefstruct
UpdatePosestruct
MainRenderTargetstruct
ReadFromResultstruct
RenderPassBuilderstruct
RenderToResultstruct
SetBinderstruct
SetLayoutstruct
Sinkstruct
Viewstruct
DebugDepthModeenum
DebugShapeenum
PipelineStateenum
RenderPassStateenum
Resourceenum
RenderPasstrait
make_perspective_view_from_camerafnBuilds a perspective [View] from a scene camera and render target extent.
RenderPassReturntype

Modules

  • debug — Retained wireframe geometry for renderer and gameplay diagnostics.
  • device — The GHI device that the rendering and loading timelines both come from.
  • loading — Loading runs on its own timeline, parallel to rendering.
  • particles — GPU-simulated particle systems.
  • camera — Camera state used to derive scene views.
  • set_layout — Descriptor set layouts the renderer shares with its shaders, and name-based binding of resources to them.
  • render_pass — Composable sink-local rendering stages.
  • resource_loading — Resource Manager to GHI utilities for loader lanes.
  • sink — Per-output render target state passed to render passes.
  • view — Projection and view matrix construction for cameras and lights.

Structs

Camera

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

Defined in crates/byte-engine/src/rendering/camera.rs:3-9

The Camera struct provides scene-owned world-space view settings to render sinks and inspection tools.

Implementations

  • fn new() -> Self

    Creates a camera with a world-origin position, default perspective settings, and neutral exposure.

  • fn vertical_fov(&self) -> Degrees

    Returns the camera's vertical field of view.

  • fn aspect_ratio(&self) -> f32

    Returns the camera's width-to-height aspect ratio.

  • fn aperture(&self) -> f32

    Returns the camera aperture.

  • fn focus_distance(&self) -> f32

    Returns the camera focus distance.

  • fn with_fov(self, fov: Degrees) -> Self

    Sets the vertical field of view used by perspective rendering.

  • fn set_fov(&mut self, fov: Degrees)

    Sets the vertical field of view used by perspective rendering.

  • fn exposure(&self) -> f32

    Returns the camera exposure in stops. See Self::set_exposure.

  • fn exposure_scale(&self) -> f32

    Returns the linear factor that the camera exposure applies to scene light, 2^exposure.

  • fn with_exposure(self, stops: f32) -> Self

    Sets the camera exposure in stops. See Self::set_exposure.

  • fn set_exposure(&mut self, stops: f32)

    Sets how much the camera brightens or darkens scene light before it is mapped to the display.

    Each stop doubles or halves the light: 0.0 shows scene values unchanged, -1.0 halves them, and 1.0

    doubles them. Scenes lit with real-world values need a matching photographic exposure: a camera at EV100 e

    uses -(e + log2(1.2)) stops, so a sunny day at EV100 15 is about -15.26.

    The PBR visibility pipeline, set up by

    crate::application::graphics::setup_pbr_visibility_shading_render_pipeline, and the atmosphere sky apply it

    as they write scene light. Storing light already exposed keeps real-world intensities within the half-float

    range of the scene color target. Scenes drawn with other pipelines ignore it.

Trait Implementations

impl ArchivePointee for Camera
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Camera
impl Clone for Camera
  • fn clone(&self) -> Camera

    Related: Camera

impl Debug for Camera
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for Camera
  • fn default() -> Self
impl Downcast for Camera
  • 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 DowncastSync for Camera
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Inspectable for Camera
  • fn as_string(&self) -> String
  • fn set(&mut self, key: &str, value: &str) -> Result<(), String>
impl Instrument for Camera
impl LayoutRaw for Camera
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Camera
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Camera
  • type Metadata = ()
impl Read for Camera
impl<R> ReadPrimitive for Camera
impl WithSubscriber for Camera

DebugMesh

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

Defined in crates/byte-engine/src/rendering/debug/mod.rs:49-53

The DebugMesh struct describes retained diagnostic geometry shared by every render sink.

Create a message with Self::new, optionally select Self::depth_mode, then publish it through the factory returned by crate::application::graphics::setup_debug_mesh_render_pass.

Implementations

  • const fn new(shape: DebugShape, color: RGBA) -> Self

    Related: DebugShape

    Creates a retained, scene-depth-aware debug mesh.

  • const fn depth_mode(self, depth_mode: DebugDepthMode) -> Self

    Related: DebugDepthMode

    Selects whether this shape tests against the scene depth image.

  • const fn shape(self) -> DebugShape

    Related: DebugShape

    Returns the world-space shape carried by this message.

  • const fn color(self) -> RGBA

    Returns the straight-alpha color written by the debug fragment shader.

  • const fn selected_depth_mode(self) -> DebugDepthMode

    Related: DebugDepthMode

    Returns the scene-depth behavior selected for this shape.

Trait Implementations

impl ArchivePointee for DebugMesh
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for DebugMesh
impl Clone for DebugMesh
  • fn clone(&self) -> DebugMesh

    Related: DebugMesh

impl Copy for DebugMesh
impl Debug for DebugMesh
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for DebugMesh
  • 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 DowncastSync for DebugMesh
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for DebugMesh
impl LayoutRaw for DebugMesh
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for DebugMesh
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for DebugMesh
  • fn eq(&self, other: &DebugMesh) -> bool

    Related: DebugMesh

impl Pointee for DebugMesh
  • type Metadata = ()
impl Read for DebugMesh
impl StructuralPartialEq for DebugMesh
impl WithSubscriber for DebugMesh

DebugMeshRenderPass

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

Defined in crates/byte-engine/src/rendering/debug/render_pass.rs:8-19

The DebugMeshRenderPass struct composites wireframe diagnostic meshes over one sink's current color image.

Register it through crate::application::graphics::setup_debug_mesh_render_pass. Register that setup after tone mapping, all other post-processing, and any overlay it should cover to keep debug colors unchanged and on top. The pass can also run before tone mapping when post-processed, scene-linear debug colors are useful.

Implementations

  • fn new(render_pass_builder: &mut RenderPassBuilder<'_>, scene: Rc<RefCell<DebugSceneManager>>) -> Self

    Related: RenderPassBuilder, DebugSceneManager

    Creates one sink-local compositing pass backed by the shared debug scene.

Trait Implementations

impl ArchivePointee for DebugMeshRenderPass
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for DebugMeshRenderPass
impl Downcast for DebugMeshRenderPass
  • 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 Instrument for DebugMeshRenderPass
impl LayoutRaw for DebugMeshRenderPass
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for DebugMeshRenderPass
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for DebugMeshRenderPass
  • type Metadata = ()
impl Read for DebugMeshRenderPass
impl RenderPass for DebugMeshRenderPass
  • fn name(&self) -> &'static str
  • fn prepare<'a>(&mut self, frame: &mut ghi::implementation::Frame<'_>, sink: &Sink, frame_allocator: &'a bumpalo::Bump) -> Option<RenderPassReturn<'a>>

    Related: Sink, RenderPassReturn

    Prepares copies and wireframe draws while preserving the incoming color and scene depth images.

  • fn bypass<'a>(&mut self, frame: &mut ghi::implementation::Frame<'_>, sink: &Sink, frame_allocator: &'a bumpalo::Bump) -> Option<RenderPassReturn<'a>>

    Related: Sink, RenderPassReturn

impl WithSubscriber for DebugMeshRenderPass

DebugSceneManager

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

Defined in crates/byte-engine/src/rendering/debug/scene_manager.rs:6-10

The DebugSceneManager struct owns reusable geometry and the retained debug scene shared by render sinks.

Applications normally create it through crate::application::graphics::setup_debug_mesh_render_pass and manage meshes through the returned crate::core::factory::Factory.

Implementations

  • fn new(context: &mut ghi::implementation::Context, listener: DefaultListener<CreateMessage<DebugMesh>>, delete_listener: DefaultListener<DeleteMessage>) -> Self

    Related: DebugMesh

    Creates the shared scene and uploads each reusable unit mesh once.

Trait Implementations

impl ArchivePointee for DebugSceneManager
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for DebugSceneManager
impl Downcast for DebugSceneManager
  • 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 DowncastSync for DebugSceneManager
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for DebugSceneManager
impl LayoutRaw for DebugSceneManager
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for DebugSceneManager
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for DebugSceneManager
  • type Metadata = ()
impl Read for DebugSceneManager
impl WithSubscriber for DebugSceneManager

GraphicsDevice

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

Defined in crates/byte-engine/src/rendering/device.rs:17-23

The GraphicsDevice struct is the shared root of the rendering and loading timelines.

Rendering and loading each own a context of this device and submit on a queue of their own: the renderer on the graphics queue and the Loader on the copy queue. Neither timeline waits on the other. Loaded resources reach the renderer only through the loader's notifications. Keep this value alive until both contexts have been dropped. The loading timeline design explains why the timelines stay independent.

Next, create the renderer with Renderer::new and the loader with Loader::new.

Implementations

  • fn new(parameters: impl Parameters) -> Self

    Creates the device, its graphics queue, and its copy queue from application parameters.

    Parameters

    Read from parameters, the render subtree of the application's:

    • debug: Enables validation layers for debugging. Defaults to true on debug builds.

    • debug.dump: Enables API dump for debugging. Defaults to false.

    • debug.extended: Enables extended validation for debugging. Defaults to false.

    • debug.labels: Enables graphics API object labels and command debug groups. Defaults to debug.

    • ghi.features.mesh-shading: Enables mesh shading features on the device. Defaults to true.

    • pipeline-cache.path: When set, the application owns the compiled pipeline cache instead of the GPU

      driver. The Renderer reads and writes the file. Defaults to none.

  • fn create_context(&self) -> ghi::implementation::Context

    Creates a context on this device for a timeline of its own.

    Each timeline owns one context and submits only on its own queue. Resources move between the contexts of one

    device with export_image and

    share_buffer.

  • fn graphics_queue(&self) -> ghi::QueueHandle

    Returns the queue the renderer records and presents frames on.

  • fn copy_queue(&self) -> ghi::QueueHandle

    Returns the queue the loader submits its upload batches on.

Trait Implementations

impl ArchivePointee for GraphicsDevice
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for GraphicsDevice
impl Downcast for GraphicsDevice
  • 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 DowncastSync for GraphicsDevice
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for GraphicsDevice
impl LayoutRaw for GraphicsDevice
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for GraphicsDevice
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for GraphicsDevice
  • type Metadata = ()
impl Read for GraphicsDevice
impl WithSubscriber for GraphicsDevice

Environment

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

Defined in crates/byte-engine/src/rendering/environment.rs:6-9

The Environment struct identifies the baked environment-map resource used for scene lighting and reflections.

Create an environment through crate::core::message_bus::MessageScope::factory after installing the visibility pipeline.

Implementations

  • fn new(resource_id: impl Into<String>) -> Self

    Creates an environment backed by the named .environment.bead resource.

    See the environment-map format

    before selecting the resource through the world factory.

  • fn with_illuminance(self, lux: f32) -> Self

    Scales the environment so it delivers lux to an upward-facing surface.

    Environment maps store light in arbitrary units, so use this to match one to real-world lights such as a

    crate::rendering::DirectionalLight sun. A clear daytime sky delivers about 10,000 to 25,000 lux and an

    overcast one about 1,000 to 10,000. Without it, the map's own values are used unchanged.

  • fn illuminance(&self) -> Option<f32>

    Returns the requested illuminance on an upward-facing surface in lux, if any. See Self::with_illuminance.

  • fn resource_id(&self) -> &str

    Returns the baked environment-map resource used to load this environment.

Trait Implementations

impl ArchivePointee for Environment
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Environment
impl Clone for Environment
impl Debug for Environment
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Environment
  • 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 DowncastSync for Environment
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Environment
impl LayoutRaw for Environment
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Environment
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Environment
  • fn eq(&self, other: &Environment) -> bool

    Related: Environment

impl Pointee for Environment
  • type Metadata = ()
impl Read for Environment
impl StructuralPartialEq for Environment
impl WithSubscriber for Environment

ExponentialHeightFog

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

Defined in crates/byte-engine/src/rendering/fog.rs:98-105

The ExponentialHeightFog struct describes the mist or haze that fills a scene and thins out with altitude.

Use it for weather such as rain mist, an overcast day, or valley haze. Install the fog pass with crate::application::graphics::setup_exponential_height_fog_render_pass, then create one fog through crate::core::message_bus::MessageScope::factory. The newest fog wins, and publishing a fog again on the same handle with crate::core::factory::Factory::derive changes it.

Implementations

  • fn new(layer: FogLayer) -> Self

    Related: FogLayer

    Creates a fog whose density follows layer.

    Next, light it with Self::with_ambient_illuminance, and add ground mist or a high haze with

    Self::with_second_layer.

  • fn with_second_layer(self, layer: FogLayer) -> Self

    Related: FogLayer

    Adds a second layer whose fog adds to the first one's.

    Use a dense layer with a steep falloff for mist that pools near the ground, such as spray from rain splashes,

    under a thinner haze that fills the whole scene. Both layers share this fog's lighting.

  • fn with_albedo(self, albedo: Vec3f) -> Self

    Sets the fraction of each color the fog scatters rather than absorbs.

    Water droplets absorb almost nothing, so the default is white. Use a darker or tinted value for smog or dust.

  • fn with_max_opacity(self, opacity: f32) -> Self

    Caps how much the fog can hide, from 0.0 to 1.0.

    Values below 1.0 keep a trace of distant surfaces and the sky visible through the thickest fog.

  • fn with_anisotropy(self, anisotropy: f32) -> Self

    Sets how strongly the fog scatters sunlight forward, from 0.0 for evenly in every direction to just below

    1.0 for a tight glow around the sun.

    Water droplets scatter forward strongly, so the default is 0.7. The sun is the newest

    crate::rendering::DirectionalLight.

  • fn with_ambient_illuminance(self, lux: f32) -> Self

    Lights the fog evenly from every direction with a sky that delivers lux to an upward-facing surface.

    Pass the same value as crate::rendering::Environment::with_illuminance so the fog matches the sky that

    lights the scene. A clear daytime sky delivers about 10,000 to 25,000 lux and an overcast one about 1,000 to

    10,000. Without it, only the sun lights the fog.

  • fn layer(&self) -> FogLayer

    Related: FogLayer

    Returns the layer given to Self::new.

  • fn second_layer(&self) -> Option<FogLayer>

    Related: FogLayer

    Returns the layer added by Self::with_second_layer, if any.

  • fn albedo(&self) -> Vec3f

    Returns the fraction of each color the fog scatters. See Self::with_albedo.

  • fn max_opacity(&self) -> f32

    Returns the most the fog can hide. See Self::with_max_opacity.

  • fn anisotropy(&self) -> f32

    Returns how strongly the fog scatters sunlight forward. See Self::with_anisotropy.

  • fn ambient_illuminance(&self) -> f32

    Returns the sky illuminance that lights the fog, in lux. See Self::with_ambient_illuminance.

Trait Implementations

impl ArchivePointee for ExponentialHeightFog
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ExponentialHeightFog
impl Clone for ExponentialHeightFog
impl Copy for ExponentialHeightFog
impl Debug for ExponentialHeightFog
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ExponentialHeightFog
  • 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 DowncastSync for ExponentialHeightFog
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ExponentialHeightFog
impl LayoutRaw for ExponentialHeightFog
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ExponentialHeightFog
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ExponentialHeightFog
impl Pointee for ExponentialHeightFog
  • type Metadata = ()
impl Read for ExponentialHeightFog
impl StructuralPartialEq for ExponentialHeightFog
impl WithSubscriber for ExponentialHeightFog

FogLayer

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

Defined in crates/byte-engine/src/rendering/fog.rs:9-14

The FogLayer struct shapes how much fog there is at each height, so one ExponentialHeightFog can stack a wide haze with a thin, dense sheet such as ground mist.

Pass one to ExponentialHeightFog::new, and optionally a second to ExponentialHeightFog::with_second_layer.

Implementations

  • fn new(density: f32) -> Self

    Creates a layer that blocks density of the light per meter at its base height.

    A density of 0.02 hides about 1 % of a surface per half meter and about 86 % of one 100 m away. Light

    rain mist is about 0.01 to 0.06, and thick fog is 0.1 or more. Next, set how quickly the layer thins

    with Self::with_height_falloff.

  • fn with_height_falloff(self, falloff: f32) -> Self

    Sets how quickly the layer thins with altitude, per meter.

    The density halves every ln(2) / falloff meters above the base height and doubles as often below it, so the

    default 0.2 halves it every 3.5 m. Use 0.0 for fog of the same density at every height, or a large value

    such as 3.0 for a sheet that hugs the ground.

  • fn with_base_height(self, height: f32) -> Self

    Sets the world-space height, in meters, at which the layer has the density given to Self::new.

  • fn with_bounds(self, bounds: AABB) -> Self

    Confines the layer to a world-space box, so it fills one area, such as a courtyard where rain splashes, instead

    of the whole scene.

    The density drops to zero at the box's faces, so a face seen edge-on shows as a sharp line. Line the faces up

    with walls, pillars, or the ground where geometry hides them, and keep the top where the layer has already

    thinned out.

  • fn density(&self) -> f32

    Returns the fraction of light the layer blocks per meter at its base height. See Self::new.

  • fn height_falloff(&self) -> f32

    Returns how quickly the layer thins with altitude, per meter. See Self::with_height_falloff.

  • fn base_height(&self) -> f32

    Returns the height at which the layer has its base density. See Self::with_base_height.

  • fn bounds(&self) -> Option<AABB>

    Returns the box the layer is confined to, if any. See Self::with_bounds.

Trait Implementations

impl ArchivePointee for FogLayer
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for FogLayer
impl Clone for FogLayer
  • fn clone(&self) -> FogLayer

    Related: FogLayer

impl Copy for FogLayer
impl Debug for FogLayer
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for FogLayer
  • 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 DowncastSync for FogLayer
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for FogLayer
impl LayoutRaw for FogLayer
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for FogLayer
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for FogLayer
  • fn eq(&self, other: &FogLayer) -> bool

    Related: FogLayer

impl Pointee for FogLayer
  • type Metadata = ()
impl Read for FogLayer
impl StructuralPartialEq for FogLayer
impl WithSubscriber for FogLayer

SetMaterialParameter

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

Defined in crates/byte-engine/src/rendering/material_parameter.rs:15-19

The SetMaterialParameter struct lets gameplay code animate a material parameter its .bema file declares Dynamic, on one entity or on every entity drawn with a material.

Send it on the world scope's channel::<SetMaterialParameter>(); see Change a parameter at runtime.

Implementations

  • fn new(entity: Handle, name: impl Into<Cow<'static, str>>, value: impl Into<bemx::Value>) -> Self

    Sets the parameter name of the materials entity renders with to value, such as 0.5 or

    [1.0, 0.0, 0.0, 1.0].

  • fn material(material: impl Into<Cow<'static, str>>, name: impl Into<Cow<'static, str>>, value: impl Into<bemx::Value>) -> Self

    Sets the parameter name of the material whose resource ID is material, such as "solid.bema", to value

    for every entity that renders with it.

Trait Implementations

impl ArchivePointee for SetMaterialParameter
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SetMaterialParameter
impl Clone for SetMaterialParameter
impl Debug for SetMaterialParameter
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for SetMaterialParameter
  • 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 DowncastSync for SetMaterialParameter
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for SetMaterialParameter
impl LayoutRaw for SetMaterialParameter
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SetMaterialParameter
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for SetMaterialParameter
  • type Metadata = ()
impl Read for SetMaterialParameter
impl WithSubscriber for SetMaterialParameter

ParticleEmitter

struct ParticleEmitter {
    pub system: String,
    pub rate: Option<f32>,
    pub burst: Option<u32>,
}

Defined in crates/byte-engine/src/rendering/particles/emitter.rs:18-25

The ParticleEmitter struct places a source of one particle system in the world, such as a grinder throwing sparks or a chimney trailing smoke.

Create one through crate::core::factory::Creator::create together with a crate::gameplay::Transform. The transform moves, turns, and scales the system's spawn modules, so a cone fires along the transform's local +Z axis. Publish a new value with crate::core::factory::Factory::derive on the same handle to change it, and delete the handle to stop it; particles already in flight finish their lives.

use byte_engine::rendering::ParticleEmitter;
let grinder = ParticleEmitter::new("byte-engine/particles/sparks.particles");
let hit = ParticleEmitter { rate: Some(0.0), burst: Some(60), ..grinder.clone() };

Fields

  • system: String

    The ID of the .particles asset this emitter spawns.

  • rate: Option<f32>

    Particles spawned per second, or None for the system's spawn.rate.

  • burst: Option<u32>

    Particles spawned once each time this value is published, or None for the system's spawn.burst.

Implementations

  • fn new(system: impl Into<String>) -> Self

    Creates an emitter that spawns system at the rate and burst its asset sets.

Trait Implementations

impl ArchivePointee for ParticleEmitter
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ParticleEmitter
impl Clone for ParticleEmitter
impl Debug for ParticleEmitter
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for ParticleEmitter
  • 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 DowncastSync for ParticleEmitter
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Inspectable for ParticleEmitter
  • fn as_string(&self) -> String
impl Instrument for ParticleEmitter
impl LayoutRaw for ParticleEmitter
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ParticleEmitter
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for ParticleEmitter
impl Pointee for ParticleEmitter
  • type Metadata = ()
impl Read for ParticleEmitter
impl StructuralPartialEq for ParticleEmitter
impl WithSubscriber for ParticleEmitter

PipelineManagerClient

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

Defined in crates/byte-engine/src/rendering/pipeline_compilation.rs:83-86

The PipelineManagerClient struct lets renderer dependants request and poll asynchronously compiled pipelines without blocking.

Clone this client for each dependant. Requests with the same inputs are coalesced before they reach a compilation server.

Implementations

  • fn request_pipeline(&self, id: &str) -> PipelineRef

    Related: PipelineRef

    Requests a pipeline resource without waiting for storage or compilation.

  • fn get(&self, pipeline: PipelineRef) -> PipelineState

    Related: PipelineRef, PipelineState

    Returns the state published for a pipeline without draining worker results.

  • fn pipeline(&self, pipeline: PipelineRef) -> Option<ghi::PipelineHandle>

    Related: PipelineRef

    Returns a published pipeline handle, or None while it is unavailable.

  • fn sets(&self, pipeline: PipelineRef) -> Option<Arc<[SetLayout]>>

    Related: PipelineRef, SetLayout

    Returns the descriptor set layouts a published pipeline's shaders declare, or None while it is unavailable.

    A pipeline of several stages reports each layout once, with the bindings any stage reaches marked as used. Next,

    create the pipeline's sets with crate::rendering::set_layout::create_sets.

Trait Implementations

impl ArchivePointee for PipelineManagerClient
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for PipelineManagerClient
impl Clone for PipelineManagerClient
impl Downcast for PipelineManagerClient
  • 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 DowncastSync for PipelineManagerClient
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for PipelineManagerClient
impl LayoutRaw for PipelineManagerClient
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for PipelineManagerClient
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for PipelineManagerClient
  • type Metadata = ()
impl Read for PipelineManagerClient
impl WithSubscriber for PipelineManagerClient

PipelineManagerServer

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

Defined in crates/byte-engine/src/rendering/pipeline_compilation.rs:215-225

The PipelineManagerServer struct compiles requests using one detached GHI factory.

Call Self::run directly from a dedicated thread. The server does not own or spawn that thread, so a future thread pool can run the same work loop.

Implementations

  • async fn run(self, resources: crate::core::EntityHandle<resource_management::ResourceManager>)

    Related: EntityHandle

    Compiles requests with shaders and pipelines read from resources until every client sender is dropped.

Trait Implementations

impl ArchivePointee for PipelineManagerServer
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for PipelineManagerServer
impl Downcast for PipelineManagerServer
  • 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 DowncastSync for PipelineManagerServer
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for PipelineManagerServer
impl LayoutRaw for PipelineManagerServer
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for PipelineManagerServer
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for PipelineManagerServer
  • type Metadata = ()
impl Read for PipelineManagerServer
impl WithSubscriber for PipelineManagerServer

PipelineRef

struct PipelineRef();

Defined in crates/byte-engine/src/rendering/pipeline_compilation.rs:12

The PipelineRef struct keeps a stable reference to a requested pipeline.

The manager derives it from the resource ID passed to PipelineManagerClient::request_pipeline, or from every input of a SpecializedComputePipelineRequest. Requests with equal inputs share one compiled pipeline.

Poll it with PipelineManagerClient::get during frame preparation. A compiled pipeline becomes visible only after the renderer publishes results at the start of a frame.

Trait Implementations

impl ArchivePointee for PipelineRef
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for PipelineRef
impl Clone for PipelineRef
impl Copy for PipelineRef
impl Debug for PipelineRef
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for PipelineRef
  • 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 DowncastSync for PipelineRef
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for PipelineRef
impl<K> Equivalent for PipelineRef
  • fn equivalent(&self, key: &K) -> bool
impl Hash for PipelineRef
  • fn hash<__H: hash::Hasher>(&self, state: &mut __H)
impl Instrument for PipelineRef
impl LayoutRaw for PipelineRef
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for PipelineRef
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for PipelineRef
  • fn eq(&self, other: &PipelineRef) -> bool

    Related: PipelineRef

impl Pointee for PipelineRef
  • type Metadata = ()
impl Read for PipelineRef
impl StructuralPartialEq for PipelineRef
impl WithSubscriber for PipelineRef

UpdatePose

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

Defined in crates/byte-engine/src/rendering/pose.rs:5-8

The UpdatePose struct carries one renderable's global skeleton pose from gameplay to rendering.

The pose holds one affine transform per skeleton node, the form skinning reads, so rendering stores it as sent.

Implementations

  • fn new(handle: Handle, global_matrices: Vec<AffineMatrix>) -> Self

    Creates a pose update for one renderable.

  • fn handle(&self) -> Handle

    Returns the renderable that owns the pose.

  • fn global_matrices(&self) -> &[AffineMatrix]

    Returns the global transform of each skeleton joint.

Trait Implementations

impl ArchivePointee for UpdatePose
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for UpdatePose
impl Clone for UpdatePose
  • fn clone(&self) -> UpdatePose

    Related: UpdatePose

impl Debug for UpdatePose
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for UpdatePose
  • 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 DowncastSync for UpdatePose
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for UpdatePose
impl LayoutRaw for UpdatePose
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for UpdatePose
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for UpdatePose
  • type Metadata = ()
impl Read for UpdatePose
impl WithSubscriber for UpdatePose

MainRenderTarget

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

Defined in crates/byte-engine/src/rendering/render_pass.rs:619-622

The MainRenderTarget struct hides whether a replacement main output is an image or the sink swapchain.

Pass it directly to simple_compute::Resource::image or convert it into a raster attachment descriptor.

Trait Implementations

impl ArchivePointee for MainRenderTarget
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for MainRenderTarget
impl Clone for MainRenderTarget
impl Copy for MainRenderTarget
impl Downcast for MainRenderTarget
  • 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 DowncastSync for MainRenderTarget
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for MainRenderTarget
impl LayoutRaw for MainRenderTarget
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for MainRenderTarget
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for MainRenderTarget
  • type Metadata = ()
impl Read for MainRenderTarget
impl WithSubscriber for MainRenderTarget

ReadFromResult

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

Defined in crates/byte-engine/src/rendering/render_pass.rs:574-576

Trait Implementations

impl ArchivePointee for ReadFromResult
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for ReadFromResult
impl Clone for ReadFromResult
impl Copy for ReadFromResult
impl Downcast for ReadFromResult
  • 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 DowncastSync for ReadFromResult
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for ReadFromResult
impl LayoutRaw for ReadFromResult
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for ReadFromResult
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for ReadFromResult
  • type Metadata = ()
impl Read for ReadFromResult
impl WithSubscriber for ReadFromResult

RenderPassBuilder<'a>

struct RenderPassBuilder<'a> {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/render_pass.rs:207-231

The RenderPassBuilder struct provides sink resources and records the dependencies of a render pass.

Declare auxiliary outputs with Self::create_render_target or Self::render_to and inputs with Self::read_from. Use Self::create_main_render_target for a replacement color result so the renderer can select the final destination. Then construct the RenderPass that records commands for those resources.

Implementations

  • fn debug_views(&mut self, views: &'static [&'static str]) -> DebugViews

    Related: DebugViews

    Declares the debug views this pass can show, at most MAX_VIEWS_PER_PASS, in the order the shader numbers

    them from 0, and returns the pool they write into.

    Each view is selectable as render.debug.view.<pass name>.<view name>, where the pass name is

    RenderPass::name or the scene pipeline manager's name. The renderer records this pass as a writer of every

    pool slot. When the project leaves debug views out, the result reports no view shown and holds no targets.

    Call it once per pass.

    Panics

    Panics on a second call, on more than MAX_VIEWS_PER_PASS views, or on a view name with a dot.

  • fn create_gpu_counter(&mut self, name: &str) -> ghi::CounterHandle

    Creates a GPU timing counter for one stage of this node's commands, which the inspector reports as

    stage.<name> next to the node's own scene.<manager> or pass.<name> time.

    Wrap the stage's commands with ghi::command_buffer::CommonCommandBufferMode::counter inside the node's

    recording, once per frame, and only on frames the stage records: a counter around no commands reports a

    meaningless near-zero time. Stage counters nest inside the node's counter, so a node's stages add up to its

    time plus whatever it records outside them.

  • fn create_scene_background(&mut self, targets: SceneBackgroundTargets) -> Option<SceneBackground>

    Related: SceneBackgroundTargets, SceneBackground

    Creates this sink's scene background, or returns None when the application registered none.

    Scene pipelines call this with their color and depth targets. Record the result after opaque surfaces and

    before transparent ones.

  • fn alias(&mut self, orig: &'a str, alias: &'a str)
  • fn format_of(&self, name: &str) -> ghi::Formats
  • fn render_to(&mut self, name: &'a str) -> RenderToResult

    Related: RenderToResult

    Returns an existing image for writing by this render pass.

  • fn create_render_target(&mut self, builder: ghi::image::Builder<'a>) -> RenderToResult

    Related: RenderToResult

    Creates a transferable render-target image and returns it for writing by this render pass.

  • fn create_scaled_render_target(&mut self, builder: ghi::image::Builder<'a>, resolution_divisor: u32) -> RenderToResult

    Related: RenderToResult

    Creates a transferable render-target image at a fraction of the sink resolution.

    The renderer sizes the image to the sink extent divided by resolution_divisor, so 2 gives a

    half-resolution target. Like every render target, it can be captured by name for debugging.

    The target holds valid contents only between the first and the last pass of a frame that uses it, since

    targets whose uses do not overlap share memory. Its contents are undefined when its first pass starts, so that

    pass must write every pixel it later reads. Use Self::create_persistent_render_target for contents that

    must survive into the next frame.

  • fn create_persistent_render_target(&mut self, builder: ghi::image::Builder<'a>) -> RenderToResult

    Related: RenderToResult

    Creates a full-resolution render target whose contents stay valid across frames.

    Use it for images a pass updates incrementally, such as a layer that only redraws damaged regions. Unlike

    Self::create_render_target, the target never shares memory with other targets.

  • fn create_history_target(&mut self, builder: ghi::image::Builder<'a>, resolution_divisor: u32) -> ghi::DynamicImageHandle

    Creates a sink-sized image that keeps one copy per frame in flight, so later frames can read it as history.

    The renderer sizes the image to the sink extent divided by resolution_divisor, but never binds it as an

    attachment, so no pass clears it.

    The creating pass writes this frame's copy. Any pass reads the previous frame's copy by binding the handle

    with ghi::DescriptorWrite::combined_image_sampler_with_frame and an offset of -1.

    A previous-frame copy holds no usable data on a sink's first frame or right after a resize, so the reading pass

    must track whether it recorded the sink at the same extent in the previous frame.

  • fn create_main_render_target(&mut self, builder: ghi::image::Builder<'a>) -> MainRenderTarget

    Related: MainRenderTarget

    Creates a replacement for the color image named main.

    The renderer supplies the sink swapchain when this pass is terminal. In

    every other position, this creates and aliases the requested image. Bind

    the returned target as a writable image without inspecting its variant.

    Compute shaders must use a formatless storage-image output because the

    swapchain format can differ from the intermediate format. Raster passes

    should derive their attachment descriptor from the returned target. Next,

    bind a compute output with simple_compute::Resource::image.

    While the pass is bypassed, the renderer copies the incoming main into the replacement, so later passes read

    the image this pass would have transformed.

  • fn read_from(&mut self, name: &'a str) -> ReadFromResult

    Related: ReadFromResult

  • fn context(&mut self) -> &mut ghi::implementation::Context
  • fn pipeline_manager(&self) -> &crate::rendering::PipelineManagerClient

    Related: PipelineManagerClient

    Returns a client for requesting pipelines shared by renderer dependants.

Trait Implementations

impl ArchivePointee for RenderPassBuilder<'a>
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for RenderPassBuilder<'a>
impl Downcast for RenderPassBuilder<'a>
  • 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 Instrument for RenderPassBuilder<'a>
impl LayoutRaw for RenderPassBuilder<'a>
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for RenderPassBuilder<'a>
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for RenderPassBuilder<'a>
  • type Metadata = ()
impl Read for RenderPassBuilder<'a>
impl WithSubscriber for RenderPassBuilder<'a>

RenderToResult

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

Defined in crates/byte-engine/src/rendering/render_pass.rs:591-594

Trait Implementations

impl ArchivePointee for RenderToResult
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for RenderToResult
impl Clone for RenderToResult
impl Copy for RenderToResult
impl Downcast for RenderToResult
  • 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 DowncastSync for RenderToResult
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for RenderToResult
impl LayoutRaw for RenderToResult
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for RenderToResult
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for RenderToResult
  • type Metadata = ()
impl Read for RenderToResult
impl WithSubscriber for RenderToResult

SetBinder<'a>

struct SetBinder<'a> {
    // [REDACTED: Private Fields]
}

Defined in crates/byte-engine/src/rendering/set_layout.rs:143-146

The SetBinder struct builds the descriptor writes of one set by BESL resource name.

Get one from SetLayout::binder, then pass its writes to ghi::context::Context::write or ghi::frame::Frame::write. Every method panics when the layout declares no resource of that name.

Implementations

  • fn set(&self) -> ghi::DescriptorSetHandle

    Returns the set the writes target.

  • fn slot(&self, name: &str) -> ghi::ResourceSlot

    Returns the slot of the resource named name, for the writes this binder has no method for.

  • fn buffer(&self, name: &str, buffer: impl Into<ghi::BaseBufferHandle>) -> ghi::DescriptorWrite

    Binds a buffer.

  • fn image(&self, name: &str, image: impl Into<ghi::BaseImageHandle>) -> ghi::DescriptorWrite

    Binds a storage image a shader loads or stores.

  • fn image_element(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, index: u32) -> ghi::DescriptorWrite

    Binds one mip of a storage image.

    Binds one element of an arrayed storage image, such as a debug target pool slot.

  • fn image_mip(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, mip_level: u32) -> ghi::DescriptorWrite
  • fn sampled(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, sampler: ghi::SamplerHandle) -> ghi::DescriptorWrite

    Binds a texture a shader samples through sampler.

  • fn sampled_with_frame(&self, name: &str, image: ghi::DynamicImageHandle, sampler: ghi::SamplerHandle, frame_offset: i32) -> ghi::DescriptorWrite

    Binds the copy of a per-frame texture that belongs to a relative frame, such as -1 for the previous frame.

  • fn sampled_element(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, sampler: ghi::SamplerHandle, index: u32) -> ghi::DescriptorWrite

    Binds one element of a texture array.

Trait Implementations

impl ArchivePointee for SetBinder<'a>
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SetBinder<'a>
impl Clone for SetBinder<'a>
  • fn clone(&self) -> SetBinder<'a>

    Related: SetBinder

impl Copy for SetBinder<'a>
impl Downcast for SetBinder<'a>
  • 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 DowncastSync for SetBinder<'a>
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for SetBinder<'a>
impl LayoutRaw for SetBinder<'a>
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SetBinder<'a>
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for SetBinder<'a>
  • type Metadata = ()
impl Read for SetBinder<'a>
impl WithSubscriber for SetBinder<'a>

SetLayout

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

Defined in crates/byte-engine/src/rendering/set_layout.rs:35-38

The SetLayout struct describes one descriptor set the renderer shares with its shaders: the GHI layout sets are created from, and the name each resource has in BESL.

Build it from a layout layer with Self::from_layers, or from a published pipeline's interface with Self::new. Next, create a set with Self::create_set and bind resources to it by name through Self::binder. Cloning is cheap; clones are the same layout.

Implementations

  • fn new(interface: &SetInterface) -> Self

    Builds the layout a baked shader declares.

  • fn from_layers(layers: &[(&str, &str)]) -> Self

    Builds the layout the last of layers declares. The layers before it are the ones it builds on, lowest first,

    as a shader's sidecar lists them. Give each layer as its name, which diagnostics show, and its source, such as

    the layer's asset path and include_str! of the file.

    Panics

    Panics when the layers do not link, or when the last layer declares no descriptor. Both are errors in the

    engine's own assets.

  • fn merged<'a>(sets: impl IntoIterator<Item = &'a SetLayout>) -> Arc<[SetLayout]>

    Related: SetLayout

    Returns each distinct layout of sets once, in first-seen order, with the bindings any of its copies uses

    marked as used.

    A pipeline's stages each declare the layouts they list; this is the pipeline's view of them.

  • fn layout(&self) -> &ghi::DescriptorSetLayout

    Returns the GHI layout, which descriptor sets are created from and shaders declare.

  • fn interface(&self) -> &SetInterface

    Returns the layout's bindings, with the names BESL gives them.

  • fn slot(&self, name: &str) -> ghi::ResourceSlot

    Returns the slot of the resource BESL names name.

    Panics

    Panics when the layout declares no such resource.

  • fn create_set(&self, context: &mut impl ContextCreate, name: &str) -> ghi::DescriptorSetHandle

    Creates an empty descriptor set for this layout. Next, write its resources through Self::binder.

  • fn binder(&self, set: ghi::DescriptorSetHandle) -> SetBinder<'_>

    Related: SetBinder

    Returns a binder that builds the writes of set, which must have been created from this layout.

Trait Implementations

impl ArchivePointee for SetLayout
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for SetLayout
impl Clone for SetLayout
  • fn clone(&self) -> SetLayout

    Related: SetLayout

impl Downcast for SetLayout
  • 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 DowncastSync for SetLayout
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for SetLayout
impl LayoutRaw for SetLayout
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for SetLayout
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for SetLayout
  • type Metadata = ()
impl Read for SetLayout
impl WithSubscriber for SetLayout

Sink

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

Defined in crates/byte-engine/src/rendering/sink.rs:11-17

The Sink struct provides a per-frame render destination for a resolved camera view.

It keeps the view transform, renderable extent, camera exposure, frame interval, and renderer sink index together while scene managers and render passes prepare an output surface.

Implementations

  • fn new(view: View, extent: Extent, index: usize) -> Self

    Related: View

    Creates a sink with neutral exposure for render passes that target a specific view and extent.

    Next, call Self::with_exposure_scale when the view comes from a crate::rendering::Camera.

  • fn with_exposure_scale(self, exposure_scale: f32) -> Self

    Sets the camera exposure as a linear factor, as returned by crate::rendering::Camera::exposure_scale.

  • fn with_frame_interval(self, frame_interval: MediaTime) -> Self

    Related: MediaTime

    Sets the time since the previous frame. Passes that simulate exposure over time, such as motion blur, scale

    what changed since the previous frame by it.

  • fn view(&self) -> View

    Related: View

    Returns the camera or light view used by this render target.

  • fn extent(&self) -> Extent

    Returns the pixel extent available to render passes for this sink.

  • fn exposure_scale(&self) -> f32

    Returns the camera exposure as a linear factor. Passes that write scene light multiply it in, so later passes

    and the tone mapper receive exposed light.

  • fn frame_interval(&self) -> MediaTime

    Related: MediaTime

    Returns the time since the previous frame, or zero when the sink was created without one, such as the

    first frame or a sink built for a test.

  • fn view_projection(&self) -> Matrix

    Returns the combined projection and view matrix for shader setup.

  • fn index(&self) -> usize

    Returns the renderer-local sink index.

Trait Implementations

impl ArchivePointee for Sink
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Sink
impl Clone for Sink
  • fn clone(&self) -> Sink

    Related: Sink

impl Copy for Sink
impl Debug for Sink
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Sink
  • 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 DowncastSync for Sink
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for Sink
impl LayoutRaw for Sink
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Sink
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl Pointee for Sink
  • type Metadata = ()
impl Read for Sink
impl WithSubscriber for Sink

View

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

Defined in crates/byte-engine/src/rendering/view.rs:7-15

The View struct provides projection and orientation data shared by cameras, lights, render sinks, and shader setup.

Implementations

  • fn new_perspective(fov: Degrees, aspect_ratio: f32, near: f32, far: f32, position: Point, direction: UnitVector) -> Self

    Creates a perspective view for camera-style scene rendering.

  • fn new_perspective_with_up(fov: Degrees, aspect_ratio: f32, near: f32, far: f32, position: Point, direction: UnitVector, up: UnitVector) -> Self

    Creates a perspective view with an explicit up direction when a stable image orientation matters.

  • fn new_orthographic(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32, position: Point, direction: UnitVector) -> Self

    Creates an orthographic view for light, editor, or flat scene rendering.

  • fn from_view(&self, view: Matrix) -> Self

    Creates a view that shares this projection but uses a caller-provided view matrix.

  • fn from_from_z_planes(&self, near: f32, far: f32) -> Self

    Creates a perspective view with this view's settings and new clipping planes.

  • fn projection(&self) -> Matrix

    Returns the projection matrix.

  • fn view(&self) -> Matrix

    Returns the view matrix.

  • fn projection_view(&self) -> Matrix

    Returns the projection matrix multiplied by the view matrix.

  • fn view_projection(&self) -> Matrix

    Returns the projection matrix multiplied by the view matrix.

  • fn x_fov(&self) -> Degrees

    Returns the horizontal field of view derived from the vertical field of view.

  • fn y_fov(&self) -> Degrees

    Returns the vertical field of view used by perspective projections.

  • fn near(&self) -> f32

    Returns the near clipping plane distance.

  • fn far(&self) -> f32

    Returns the far clipping plane distance.

  • fn fov(&self) -> [f32; 2]

    Returns the horizontal and vertical fields of view.

  • fn aspect_ratio(&self) -> f32

    Returns the width-to-height aspect ratio used by perspective projections.

  • fn get_frustum_corners(&self) -> [Point; 8]

    Returns the view-frustum corners as world-space points.

  • fn get_frustum_planes(&self) -> [Plane; 6]

    Returns the view-frustum planes in world space.

Trait Implementations

impl ArchivePointee for View
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for View
impl Clone for View
  • fn clone(&self) -> View

    Related: View

impl Copy for View
impl Debug for View
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for View
  • 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 DowncastSync for View
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for View
impl LayoutRaw for View
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for View
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for View
  • fn eq(&self, other: &View) -> bool

    Related: View

impl Pointee for View
  • type Metadata = ()
impl Read for View
impl StructuralPartialEq for View
impl WithSubscriber for View

Enums

DebugDepthMode

enum DebugDepthMode {
    Scene,
    Ignore,
}

Defined in crates/byte-engine/src/rendering/debug/mod.rs:35-41

The DebugDepthMode enum selects whether a debug shape is hidden by nearer scene geometry.

Variants

  • Scene

    Tests against the depth image produced by the active scene pipeline without changing it.

  • Ignore

    Draws after depth-aware debug geometry without a depth attachment.

Trait Implementations

impl ArchivePointee for DebugDepthMode
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for DebugDepthMode
impl Clone for DebugDepthMode
impl Copy for DebugDepthMode
impl Debug for DebugDepthMode
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for DebugDepthMode
impl Downcast for DebugDepthMode
  • 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 DowncastSync for DebugDepthMode
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for DebugDepthMode
impl<K> Equivalent for DebugDepthMode
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for DebugDepthMode
impl LayoutRaw for DebugDepthMode
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for DebugDepthMode
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for DebugDepthMode
  • fn eq(&self, other: &DebugDepthMode) -> bool

    Related: DebugDepthMode

impl Pointee for DebugDepthMode
  • type Metadata = ()
impl Read for DebugDepthMode
impl<R> ReadPrimitive for DebugDepthMode
impl StructuralPartialEq for DebugDepthMode
impl WithSubscriber for DebugDepthMode

DebugShape

enum DebugShape {
    Sphere {
        center: math::Point,
        radius: f32,
    },
    Box {
        center: math::Point,
        half_extents: math::Vector,
        orientation: math::Orientation,
    },
    Capsule {
        start: math::Point,
        end: math::Point,
        radius: f32,
    },
    Segment {
        start: math::Point,
        end: math::Point,
    },
    Circle {
        center: math::Point,
        radius: f32,
        normal: math::UnitVector,
    },
}

Defined in crates/byte-engine/src/rendering/debug/mod.rs:16-31

The DebugShape enum describes world-space geometry expanded by the debug scene manager.

Variants

  • Sphere

    A sphere centered at center with a world-space radius.

  • Box

    An oriented box whose size extends by half_extents from center.

  • Capsule

    A capsule whose center line runs from start to end.

  • Segment

    A thin line segment between two world-space endpoints.

  • Circle

    A circle of radius around center in the plane normal is perpendicular to, such as a footprint on the floor.

Trait Implementations

impl ArchivePointee for DebugShape
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for DebugShape
impl Clone for DebugShape
  • fn clone(&self) -> DebugShape

    Related: DebugShape

impl Copy for DebugShape
impl Debug for DebugShape
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for DebugShape
  • 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 DowncastSync for DebugShape
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Instrument for DebugShape
impl LayoutRaw for DebugShape
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for DebugShape
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for DebugShape
  • fn eq(&self, other: &DebugShape) -> bool

    Related: DebugShape

impl Pointee for DebugShape
  • type Metadata = ()
impl Read for DebugShape
impl StructuralPartialEq for DebugShape
impl WithSubscriber for DebugShape

PipelineState

enum PipelineState {
    Pending,
    Ready(ghi::PipelineHandle),
    Failed,
}

Defined in crates/byte-engine/src/rendering/pipeline_compilation.rs:44-51

The PipelineState enum reports the published state of a pipeline request.

Variants

  • Pending

    Compilation is queued or still running.

  • Ready

    Compilation succeeded and published this pipeline handle.

  • Failed

    Loading or compilation failed.

Trait Implementations

impl ArchivePointee for PipelineState
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for PipelineState
impl Clone for PipelineState
impl Copy for PipelineState
impl Debug for PipelineState
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for PipelineState
  • 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 DowncastSync for PipelineState
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for PipelineState
impl<K> Equivalent for PipelineState
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for PipelineState
impl LayoutRaw for PipelineState
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for PipelineState
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for PipelineState
  • fn eq(&self, other: &PipelineState) -> bool

    Related: PipelineState

impl Pointee for PipelineState
  • type Metadata = ()
impl Read for PipelineState
impl StructuralPartialEq for PipelineState
impl WithSubscriber for PipelineState

RenderPassState

enum RenderPassState {
    Enabled,
    Bypassed,
}

Defined in crates/byte-engine/src/rendering/render_pass.rs:88-92

The RenderPassState enum identifies which preparation path a render pass uses: RenderPass::prepare or RenderPass::bypass.

Trait Implementations

impl ArchivePointee for RenderPassState
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for RenderPassState
impl Clone for RenderPassState
impl Copy for RenderPassState
impl Debug for RenderPassState
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for RenderPassState
impl Downcast for RenderPassState
  • 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 DowncastSync for RenderPassState
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for RenderPassState
impl<K> Equivalent for RenderPassState
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for RenderPassState
impl LayoutRaw for RenderPassState
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for RenderPassState
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for RenderPassState
impl Pointee for RenderPassState
  • type Metadata = ()
impl Read for RenderPassState
impl<R> ReadPrimitive for RenderPassState
impl StructuralPartialEq for RenderPassState
impl WithSubscriber for RenderPassState

Resource

enum Resource {
    Id(&'static str),
    Query(Query),
}

Defined in crates/byte-engine/src/rendering/resource.rs:17-25

The Resource enum asks scene pipelines to start loading resources before any entity uses them.

Create it through the world scope's creation factory (crate::core::message_bus::MessageScope::factory), for example world.create(Resource::new("meshes/Box.gltf")). Each installed scene pipeline reads the stored class of every named resource and starts the matching load during the renderer's next update, so later entities that use the resource adopt the resident copy. Meshes also load their materials, textures, and material pipelines.

Install the scene pipeline before creating resources; creations without a listening pipeline are dropped.

Variants

  • Id

    One resource by ID.

  • Query

    Every stored resource that matches an indexed metadata query.

    The query runs on the pipeline's loader, so it never blocks the caller. Development builds only match resources that were already baked.

Implementations

  • fn new(id: &'static str) -> Self

    Names one resource to load.

  • fn query(query: impl Into<Query>) -> Self

    Related: Query

    Loads every resource that matches query.

Trait Implementations

impl ArchivePointee for Resource
  • type ArchivedMetadata = ()
  • fn pointer_metadata(_: &<T as ArchivePointee>::ArchivedMetadata) -> <T as Pointee>::Metadata
impl<ST> CastableFrom for Resource
impl Clone for Resource
  • fn clone(&self) -> Resource

    Related: Resource

impl Debug for Resource
  • fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Downcast for Resource
  • 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 DowncastSync for Resource
  • fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
impl Eq for Resource
impl<K> Equivalent for Resource
  • fn equivalent(&self, key: &K) -> bool
impl Instrument for Resource
impl LayoutRaw for Resource
  • fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T, N1> Niching for Resource
  • unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
  • fn resolve_niched(out: Place<NichedOption<T, N1>>)
impl PartialEq for Resource
  • fn eq(&self, other: &Resource) -> bool

    Related: Resource

impl Pointee for Resource
  • type Metadata = ()
impl Read for Resource
impl StructuralPartialEq for Resource
impl WithSubscriber for Resource

Traits

RenderPass

trait RenderPass { ... }

Defined in crates/byte-engine/src/rendering/render_pass.rs:48-83

The RenderPass trait defines a composable rendering step for a prepared sink.

Build persistent images and shader state through RenderPassBuilder, then return frame-local recording work from Self::prepare. Register the implementation with crate::rendering::renderer::Renderer.

Required Methods

  • fn name(&self) -> &'static str

    Returns the stable name used to control every sink-local instance of this pass.

  • fn prepare<'a>(&mut self, frame: &mut ghi::implementation::Frame<'_>, sink: &Sink, frame_allocator: &'a bumpalo::Bump) -> Option<RenderPassReturn<'a>>

    Prepares the render pass when its rendering condition is active.

Provided Methods

  • fn bypass<'a>(&mut self, _frame: &mut ghi::implementation::Frame<'_>, _sink: &Sink, _frame_allocator: &'a bumpalo::Bump) -> Option<RenderPassReturn<'a>>

    Prepares the maintenance work this pass still needs while it is bypassed.

  • fn needs_frame(&mut self) -> bool

    Reports whether this pass has output that the last presented frame does not show yet.

Implementors

Functions

make_perspective_view_from_camera

fn make_perspective_view_from_camera<T: Positionable + Orientable>(camera: &Camera, po: &T, extent: ::utils::Extent) -> View

Defined in crates/byte-engine/src/rendering/mod.rs:127-145

Builds a perspective View from a scene camera and render target extent.

Type Aliases

RenderPassReturn<'a>

type RenderPassReturn<'a> = &'a dyn RenderPassFunction + Send + Sync;

Defined in crates/byte-engine/src/rendering/render_pass.rs:33

A frame-allocated command that records one render pass.

On this page

Module renderingContentsQuick ReferenceModulesStructsCameraImplementationsTrait Implementationsimpl ArchivePointee for Cameraimpl<ST> CastableFrom for Cameraimpl Clone for Cameraimpl Debug for Cameraimpl Default for Cameraimpl Downcast for Cameraimpl DowncastSync for Cameraimpl Inspectable for Cameraimpl Instrument for Cameraimpl LayoutRaw for Cameraimpl<T, N1> Niching for Cameraimpl Pointee for Cameraimpl Read for Cameraimpl<R> ReadPrimitive for Cameraimpl WithSubscriber for CameraDebugMeshImplementationsTrait Implementationsimpl ArchivePointee for DebugMeshimpl<ST> CastableFrom for DebugMeshimpl Clone for DebugMeshimpl Copy for DebugMeshimpl Debug for DebugMeshimpl Downcast for DebugMeshimpl DowncastSync for DebugMeshimpl Instrument for DebugMeshimpl LayoutRaw for DebugMeshimpl<T, N1> Niching for DebugMeshimpl PartialEq for DebugMeshimpl Pointee for DebugMeshimpl Read for DebugMeshimpl StructuralPartialEq for DebugMeshimpl WithSubscriber for DebugMeshDebugMeshRenderPassImplementationsTrait Implementationsimpl ArchivePointee for DebugMeshRenderPassimpl<ST> CastableFrom for DebugMeshRenderPassimpl Downcast for DebugMeshRenderPassimpl Instrument for DebugMeshRenderPassimpl LayoutRaw for DebugMeshRenderPassimpl<T, N1> Niching for DebugMeshRenderPassimpl Pointee for DebugMeshRenderPassimpl Read for DebugMeshRenderPassimpl RenderPass for DebugMeshRenderPassimpl WithSubscriber for DebugMeshRenderPassDebugSceneManagerImplementationsTrait Implementationsimpl ArchivePointee for DebugSceneManagerimpl<ST> CastableFrom for DebugSceneManagerimpl Downcast for DebugSceneManagerimpl DowncastSync for DebugSceneManagerimpl Instrument for DebugSceneManagerimpl LayoutRaw for DebugSceneManagerimpl<T, N1> Niching for DebugSceneManagerimpl Pointee for DebugSceneManagerimpl Read for DebugSceneManagerimpl WithSubscriber for DebugSceneManagerGraphicsDeviceImplementationsParametersTrait Implementationsimpl ArchivePointee for GraphicsDeviceimpl<ST> CastableFrom for GraphicsDeviceimpl Downcast for GraphicsDeviceimpl DowncastSync for GraphicsDeviceimpl Instrument for GraphicsDeviceimpl LayoutRaw for GraphicsDeviceimpl<T, N1> Niching for GraphicsDeviceimpl Pointee for GraphicsDeviceimpl Read for GraphicsDeviceimpl WithSubscriber for GraphicsDeviceEnvironmentImplementationsTrait Implementationsimpl ArchivePointee for Environmentimpl<ST> CastableFrom for Environmentimpl Clone for Environmentimpl Debug for Environmentimpl Downcast for Environmentimpl DowncastSync for Environmentimpl Instrument for Environmentimpl LayoutRaw for Environmentimpl<T, N1> Niching for Environmentimpl PartialEq for Environmentimpl Pointee for Environmentimpl Read for Environmentimpl StructuralPartialEq for Environmentimpl WithSubscriber for EnvironmentExponentialHeightFogImplementationsTrait Implementationsimpl ArchivePointee for ExponentialHeightFogimpl<ST> CastableFrom for ExponentialHeightFogimpl Clone for ExponentialHeightFogimpl Copy for ExponentialHeightFogimpl Debug for ExponentialHeightFogimpl Downcast for ExponentialHeightFogimpl DowncastSync for ExponentialHeightFogimpl Instrument for ExponentialHeightFogimpl LayoutRaw for ExponentialHeightFogimpl<T, N1> Niching for ExponentialHeightFogimpl PartialEq for ExponentialHeightFogimpl Pointee for ExponentialHeightFogimpl Read for ExponentialHeightFogimpl StructuralPartialEq for ExponentialHeightFogimpl WithSubscriber for ExponentialHeightFogFogLayerImplementationsTrait Implementationsimpl ArchivePointee for FogLayerimpl<ST> CastableFrom for FogLayerimpl Clone for FogLayerimpl Copy for FogLayerimpl Debug for FogLayerimpl Downcast for FogLayerimpl DowncastSync for FogLayerimpl Instrument for FogLayerimpl LayoutRaw for FogLayerimpl<T, N1> Niching for FogLayerimpl PartialEq for FogLayerimpl Pointee for FogLayerimpl Read for FogLayerimpl StructuralPartialEq for FogLayerimpl WithSubscriber for FogLayerSetMaterialParameterImplementationsTrait Implementationsimpl ArchivePointee for SetMaterialParameterimpl<ST> CastableFrom for SetMaterialParameterimpl Clone for SetMaterialParameterimpl Debug for SetMaterialParameterimpl Downcast for SetMaterialParameterimpl DowncastSync for SetMaterialParameterimpl Instrument for SetMaterialParameterimpl LayoutRaw for SetMaterialParameterimpl<T, N1> Niching for SetMaterialParameterimpl Pointee for SetMaterialParameterimpl Read for SetMaterialParameterimpl WithSubscriber for SetMaterialParameterParticleEmitterFieldsImplementationsTrait Implementationsimpl ArchivePointee for ParticleEmitterimpl<ST> CastableFrom for ParticleEmitterimpl Clone for ParticleEmitterimpl Debug for ParticleEmitterimpl Downcast for ParticleEmitterimpl DowncastSync for ParticleEmitterimpl Inspectable for ParticleEmitterimpl Instrument for ParticleEmitterimpl LayoutRaw for ParticleEmitterimpl<T, N1> Niching for ParticleEmitterimpl PartialEq for ParticleEmitterimpl Pointee for ParticleEmitterimpl Read for ParticleEmitterimpl StructuralPartialEq for ParticleEmitterimpl WithSubscriber for ParticleEmitterPipelineManagerClientImplementationsTrait Implementationsimpl ArchivePointee for PipelineManagerClientimpl<ST> CastableFrom for PipelineManagerClientimpl Clone for PipelineManagerClientimpl Downcast for PipelineManagerClientimpl DowncastSync for PipelineManagerClientimpl Instrument for PipelineManagerClientimpl LayoutRaw for PipelineManagerClientimpl<T, N1> Niching for PipelineManagerClientimpl Pointee for PipelineManagerClientimpl Read for PipelineManagerClientimpl WithSubscriber for PipelineManagerClientPipelineManagerServerImplementationsTrait Implementationsimpl ArchivePointee for PipelineManagerServerimpl<ST> CastableFrom for PipelineManagerServerimpl Downcast for PipelineManagerServerimpl DowncastSync for PipelineManagerServerimpl Instrument for PipelineManagerServerimpl LayoutRaw for PipelineManagerServerimpl<T, N1> Niching for PipelineManagerServerimpl Pointee for PipelineManagerServerimpl Read for PipelineManagerServerimpl WithSubscriber for PipelineManagerServerPipelineRefTrait Implementationsimpl ArchivePointee for PipelineRefimpl<ST> CastableFrom for PipelineRefimpl Clone for PipelineRefimpl Copy for PipelineRefimpl Debug for PipelineRefimpl Downcast for PipelineRefimpl DowncastSync for PipelineRefimpl Eq for PipelineRefimpl<K> Equivalent for PipelineRefimpl Hash for PipelineRefimpl Instrument for PipelineRefimpl LayoutRaw for PipelineRefimpl<T, N1> Niching for PipelineRefimpl PartialEq for PipelineRefimpl Pointee for PipelineRefimpl Read for PipelineRefimpl StructuralPartialEq for PipelineRefimpl WithSubscriber for PipelineRefUpdatePoseImplementationsTrait Implementationsimpl ArchivePointee for UpdatePoseimpl<ST> CastableFrom for UpdatePoseimpl Clone for UpdatePoseimpl Debug for UpdatePoseimpl Downcast for UpdatePoseimpl DowncastSync for UpdatePoseimpl Instrument for UpdatePoseimpl LayoutRaw for UpdatePoseimpl<T, N1> Niching for UpdatePoseimpl Pointee for UpdatePoseimpl Read for UpdatePoseimpl WithSubscriber for UpdatePoseMainRenderTargetTrait Implementationsimpl ArchivePointee for MainRenderTargetimpl<ST> CastableFrom for MainRenderTargetimpl Clone for MainRenderTargetimpl Copy for MainRenderTargetimpl Downcast for MainRenderTargetimpl DowncastSync for MainRenderTargetimpl Instrument for MainRenderTargetimpl LayoutRaw for MainRenderTargetimpl<T, N1> Niching for MainRenderTargetimpl Pointee for MainRenderTargetimpl Read for MainRenderTargetimpl WithSubscriber for MainRenderTargetReadFromResultTrait Implementationsimpl ArchivePointee for ReadFromResultimpl<ST> CastableFrom for ReadFromResultimpl Clone for ReadFromResultimpl Copy for ReadFromResultimpl Downcast for ReadFromResultimpl DowncastSync for ReadFromResultimpl Instrument for ReadFromResultimpl LayoutRaw for ReadFromResultimpl<T, N1> Niching for ReadFromResultimpl Pointee for ReadFromResultimpl Read for ReadFromResultimpl WithSubscriber for ReadFromResultRenderPassBuilder<'a>ImplementationsPanicsTrait Implementationsimpl ArchivePointee for RenderPassBuilder<'a>impl<ST> CastableFrom for RenderPassBuilder<'a>impl Downcast for RenderPassBuilder<'a>impl Instrument for RenderPassBuilder<'a>impl LayoutRaw for RenderPassBuilder<'a>impl<T, N1> Niching for RenderPassBuilder<'a>impl Pointee for RenderPassBuilder<'a>impl Read for RenderPassBuilder<'a>impl WithSubscriber for RenderPassBuilder<'a>RenderToResultTrait Implementationsimpl ArchivePointee for RenderToResultimpl<ST> CastableFrom for RenderToResultimpl Clone for RenderToResultimpl Copy for RenderToResultimpl Downcast for RenderToResultimpl DowncastSync for RenderToResultimpl Instrument for RenderToResultimpl LayoutRaw for RenderToResultimpl<T, N1> Niching for RenderToResultimpl Pointee for RenderToResultimpl Read for RenderToResultimpl WithSubscriber for RenderToResultSetBinder<'a>ImplementationsTrait Implementationsimpl ArchivePointee for SetBinder<'a>impl<ST> CastableFrom for SetBinder<'a>impl Clone for SetBinder<'a>impl Copy for SetBinder<'a>impl Downcast for SetBinder<'a>impl DowncastSync for SetBinder<'a>impl Instrument for SetBinder<'a>impl LayoutRaw for SetBinder<'a>impl<T, N1> Niching for SetBinder<'a>impl Pointee for SetBinder<'a>impl Read for SetBinder<'a>impl WithSubscriber for SetBinder<'a>SetLayoutImplementationsPanicsPanicsTrait Implementationsimpl ArchivePointee for SetLayoutimpl<ST> CastableFrom for SetLayoutimpl Clone for SetLayoutimpl Downcast for SetLayoutimpl DowncastSync for SetLayoutimpl Instrument for SetLayoutimpl LayoutRaw for SetLayoutimpl<T, N1> Niching for SetLayoutimpl Pointee for SetLayoutimpl Read for SetLayoutimpl WithSubscriber for SetLayoutSinkImplementationsTrait Implementationsimpl ArchivePointee for Sinkimpl<ST> CastableFrom for Sinkimpl Clone for Sinkimpl Copy for Sinkimpl Debug for Sinkimpl Downcast for Sinkimpl DowncastSync for Sinkimpl Instrument for Sinkimpl LayoutRaw for Sinkimpl<T, N1> Niching for Sinkimpl Pointee for Sinkimpl Read for Sinkimpl WithSubscriber for SinkViewImplementationsTrait Implementationsimpl ArchivePointee for Viewimpl<ST> CastableFrom for Viewimpl Clone for Viewimpl Copy for Viewimpl Debug for Viewimpl Downcast for Viewimpl DowncastSync for Viewimpl Instrument for Viewimpl LayoutRaw for Viewimpl<T, N1> Niching for Viewimpl PartialEq for Viewimpl Pointee for Viewimpl Read for Viewimpl StructuralPartialEq for Viewimpl WithSubscriber for ViewEnumsDebugDepthModeVariantsTrait Implementationsimpl ArchivePointee for DebugDepthModeimpl<ST> CastableFrom for DebugDepthModeimpl Clone for DebugDepthModeimpl Copy for DebugDepthModeimpl Debug for DebugDepthModeimpl Default for DebugDepthModeimpl Downcast for DebugDepthModeimpl DowncastSync for DebugDepthModeimpl Eq for DebugDepthModeimpl<K> Equivalent for DebugDepthModeimpl Instrument for DebugDepthModeimpl LayoutRaw for DebugDepthModeimpl<T, N1> Niching for DebugDepthModeimpl PartialEq for DebugDepthModeimpl Pointee for DebugDepthModeimpl Read for DebugDepthModeimpl<R> ReadPrimitive for DebugDepthModeimpl StructuralPartialEq for DebugDepthModeimpl WithSubscriber for DebugDepthModeDebugShapeVariantsTrait Implementationsimpl ArchivePointee for DebugShapeimpl<ST> CastableFrom for DebugShapeimpl Clone for DebugShapeimpl Copy for DebugShapeimpl Debug for DebugShapeimpl Downcast for DebugShapeimpl DowncastSync for DebugShapeimpl Instrument for DebugShapeimpl LayoutRaw for DebugShapeimpl<T, N1> Niching for DebugShapeimpl PartialEq for DebugShapeimpl Pointee for DebugShapeimpl Read for DebugShapeimpl StructuralPartialEq for DebugShapeimpl WithSubscriber for DebugShapePipelineStateVariantsTrait Implementationsimpl ArchivePointee for PipelineStateimpl<ST> CastableFrom for PipelineStateimpl Clone for PipelineStateimpl Copy for PipelineStateimpl Debug for PipelineStateimpl Downcast for PipelineStateimpl DowncastSync for PipelineStateimpl Eq for PipelineStateimpl<K> Equivalent for PipelineStateimpl Instrument for PipelineStateimpl LayoutRaw for PipelineStateimpl<T, N1> Niching for PipelineStateimpl PartialEq for PipelineStateimpl Pointee for PipelineStateimpl Read for PipelineStateimpl StructuralPartialEq for PipelineStateimpl WithSubscriber for PipelineStateRenderPassStateTrait Implementationsimpl ArchivePointee for RenderPassStateimpl<ST> CastableFrom for RenderPassStateimpl Clone for RenderPassStateimpl Copy for RenderPassStateimpl Debug for RenderPassStateimpl Default for RenderPassStateimpl Downcast for RenderPassStateimpl DowncastSync for RenderPassStateimpl Eq for RenderPassStateimpl<K> Equivalent for RenderPassStateimpl Instrument for RenderPassStateimpl LayoutRaw for RenderPassStateimpl<T, N1> Niching for RenderPassStateimpl PartialEq for RenderPassStateimpl Pointee for RenderPassStateimpl Read for RenderPassStateimpl<R> ReadPrimitive for RenderPassStateimpl StructuralPartialEq for RenderPassStateimpl WithSubscriber for RenderPassStateResourceVariantsImplementationsTrait Implementationsimpl ArchivePointee for Resourceimpl<ST> CastableFrom for Resourceimpl Clone for Resourceimpl Debug for Resourceimpl Downcast for Resourceimpl DowncastSync for Resourceimpl Eq for Resourceimpl<K> Equivalent for Resourceimpl Instrument for Resourceimpl LayoutRaw for Resourceimpl<T, N1> Niching for Resourceimpl PartialEq for Resourceimpl Pointee for Resourceimpl Read for Resourceimpl StructuralPartialEq for Resourceimpl WithSubscriber for ResourceTraitsRenderPassRequired MethodsProvided MethodsImplementorsFunctionsmake_perspective_view_from_cameraType AliasesRenderPassReturn<'a>