rendering
Generated Rust API reference for byte_engine.
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
- Modules
- Structs
CameraDebugMeshDebugMeshRenderPassDebugSceneManagerGraphicsDeviceEnvironmentExponentialHeightFogFogLayerSetMaterialParameterParticleEmitterPipelineManagerClientPipelineManagerServerPipelineRefUpdatePoseMainRenderTargetReadFromResultRenderPassBuilderRenderToResultSetBinderSetLayoutSinkView
- Enums
- Traits
- Functions
- Type Aliases
Quick Reference
| Item | Kind | Description |
|---|---|---|
debug | mod | Retained wireframe geometry for renderer and gameplay diagnostics. |
device | mod | The GHI device that the rendering and loading timelines both come from. |
loading | mod | Loading runs on its own timeline, parallel to rendering. |
particles | mod | GPU-simulated particle systems. |
camera | mod | Camera state used to derive scene views. |
set_layout | mod | Descriptor set layouts the renderer shares with its shaders, and name-based binding of resources to them. |
render_pass | mod | Composable sink-local rendering stages. |
resource_loading | mod | Resource Manager to GHI utilities for loader lanes. |
sink | mod | Per-output render target state passed to render passes. |
view | mod | Projection and view matrix construction for cameras and lights. |
Camera | struct | |
DebugMesh | struct | |
DebugMeshRenderPass | struct | |
DebugSceneManager | struct | |
GraphicsDevice | struct | |
Environment | struct | |
ExponentialHeightFog | struct | |
FogLayer | struct | |
SetMaterialParameter | struct | |
ParticleEmitter | struct | |
PipelineManagerClient | struct | |
PipelineManagerServer | struct | |
PipelineRef | struct | |
UpdatePose | struct | |
MainRenderTarget | struct | |
ReadFromResult | struct | |
RenderPassBuilder | struct | |
RenderToResult | struct | |
SetBinder | struct | |
SetLayout | struct | |
Sink | struct | |
View | struct | |
DebugDepthMode | enum | |
DebugShape | enum | |
PipelineState | enum | |
RenderPassState | enum | |
Resource | enum | |
RenderPass | trait | |
make_perspective_view_from_camera | fn | Builds a perspective [View] from a scene camera and render target extent. |
RenderPassReturn | type |
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() -> SelfCreates a camera with a world-origin position, default perspective settings, and neutral exposure.
-
fn vertical_fov(&self) -> DegreesReturns the camera's vertical field of view.
-
fn aspect_ratio(&self) -> f32Returns the camera's width-to-height aspect ratio.
-
fn aperture(&self) -> f32Returns the camera aperture.
-
fn focus_distance(&self) -> f32Returns the camera focus distance.
-
fn with_fov(self, fov: Degrees) -> SelfSets 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) -> f32Returns the camera exposure in stops. See
Self::set_exposure. -
fn exposure_scale(&self) -> f32Returns the linear factor that the camera exposure applies to scene light,
2^exposure. -
fn with_exposure(self, stops: f32) -> SelfSets 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.0shows scene values unchanged,-1.0halves them, and1.0doubles them. Scenes lit with real-world values need a matching photographic exposure: a camera at EV100
euses
-(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 itas 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) -> CameraRelated:
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) -> SelfRelated:
DebugShapeCreates a retained, scene-depth-aware debug mesh.
-
const fn depth_mode(self, depth_mode: DebugDepthMode) -> SelfRelated:
DebugDepthModeSelects whether this shape tests against the scene depth image.
-
const fn shape(self) -> DebugShapeRelated:
DebugShapeReturns the world-space shape carried by this message.
-
const fn color(self) -> RGBAReturns the straight-alpha color written by the debug fragment shader.
-
const fn selected_depth_mode(self) -> DebugDepthModeRelated:
DebugDepthModeReturns 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) -> DebugMeshRelated:
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) -> boolRelated:
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>>) -> SelfRelated:
RenderPassBuilder,DebugSceneManagerCreates 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,RenderPassReturnPrepares 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>) -> SelfRelated:
DebugMeshCreates 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) -> SelfCreates the device, its graphics queue, and its copy queue from application parameters.
Parameters
Read from
parameters, therendersubtree 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 todebug. -
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 GPUdriver. The
Rendererreads and writes the file. Defaults to none.
-
-
fn create_context(&self) -> ghi::implementation::ContextCreates 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_imageand -
fn graphics_queue(&self) -> ghi::QueueHandleReturns the queue the renderer records and presents frames on.
-
fn copy_queue(&self) -> ghi::QueueHandleReturns 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>) -> SelfCreates an environment backed by the named
.environment.beadresource.See the environment-map format
before selecting the resource through the world factory.
-
fn with_illuminance(self, lux: f32) -> SelfScales the environment so it delivers
luxto 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::DirectionalLightsun. A clear daytime sky delivers about 10,000 to 25,000 lux and anovercast 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) -> &strReturns 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
-
fn clone(&self) -> EnvironmentRelated:
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) -> boolRelated:
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) -> SelfRelated:
FogLayerCreates a fog whose density follows
layer.Next, light it with
Self::with_ambient_illuminance, and add ground mist or a high haze with -
fn with_second_layer(self, layer: FogLayer) -> SelfRelated:
FogLayerAdds 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) -> SelfSets 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) -> SelfCaps how much the fog can hide, from
0.0to1.0.Values below
1.0keep a trace of distant surfaces and the sky visible through the thickest fog. -
fn with_anisotropy(self, anisotropy: f32) -> SelfSets how strongly the fog scatters sunlight forward, from
0.0for evenly in every direction to just below1.0for a tight glow around the sun.Water droplets scatter forward strongly, so the default is
0.7. The sun is the newest -
fn with_ambient_illuminance(self, lux: f32) -> SelfLights the fog evenly from every direction with a sky that delivers
luxto an upward-facing surface.Pass the same value as
crate::rendering::Environment::with_illuminanceso the fog matches the sky thatlights 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) -> FogLayerRelated:
FogLayerReturns the layer given to
Self::new. -
fn second_layer(&self) -> Option<FogLayer>Related:
FogLayerReturns the layer added by
Self::with_second_layer, if any. -
fn albedo(&self) -> Vec3fReturns the fraction of each color the fog scatters. See
Self::with_albedo. -
fn max_opacity(&self) -> f32Returns the most the fog can hide. See
Self::with_max_opacity. -
fn anisotropy(&self) -> f32Returns how strongly the fog scatters sunlight forward. See
Self::with_anisotropy. -
fn ambient_illuminance(&self) -> f32Returns 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
-
fn clone(&self) -> ExponentialHeightFogRelated:
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
-
fn eq(&self, other: &ExponentialHeightFog) -> boolRelated:
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) -> SelfCreates a layer that blocks
densityof the light per meter at its base height.A density of
0.02hides about 1 % of a surface per half meter and about 86 % of one 100 m away. Lightrain mist is about
0.01to0.06, and thick fog is0.1or more. Next, set how quickly the layer thins -
fn with_height_falloff(self, falloff: f32) -> SelfSets how quickly the layer thins with altitude, per meter.
The density halves every
ln(2) / falloffmeters above the base height and doubles as often below it, so thedefault
0.2halves it every 3.5 m. Use0.0for fog of the same density at every height, or a large valuesuch as
3.0for a sheet that hugs the ground. -
fn with_base_height(self, height: f32) -> SelfSets the world-space height, in meters, at which the layer has the density given to
Self::new. -
fn with_bounds(self, bounds: AABB) -> SelfConfines 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) -> f32Returns the fraction of light the layer blocks per meter at its base height. See
Self::new. -
fn height_falloff(&self) -> f32Returns how quickly the layer thins with altitude, per meter. See
Self::with_height_falloff. -
fn base_height(&self) -> f32Returns 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) -> FogLayerRelated:
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) -> boolRelated:
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>) -> SelfSets the parameter
nameof the materialsentityrenders with tovalue, such as0.5or[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>) -> SelfSets the parameter
nameof the material whose resource ID ismaterial, such as"solid.bema", tovaluefor 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
-
fn clone(&self) -> SetMaterialParameterRelated:
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:StringThe ID of the
.particlesasset this emitter spawns. -
rate:Option<f32>Particles spawned per second, or
Nonefor the system'sspawn.rate. -
burst:Option<u32>Particles spawned once each time this value is published, or
Nonefor the system'sspawn.burst.
Implementations
-
fn new(system: impl Into<String>) -> SelfCreates an emitter that spawns
systemat 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
-
fn clone(&self) -> ParticleEmitterRelated:
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
-
fn eq(&self, other: &ParticleEmitter) -> boolRelated:
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) -> PipelineRefRelated:
PipelineRefRequests a pipeline resource without waiting for storage or compilation.
-
fn get(&self, pipeline: PipelineRef) -> PipelineStateRelated:
PipelineRef,PipelineStateReturns the state published for a pipeline without draining worker results.
-
fn pipeline(&self, pipeline: PipelineRef) -> Option<ghi::PipelineHandle>Related:
PipelineRefReturns a published pipeline handle, or
Nonewhile it is unavailable. -
fn sets(&self, pipeline: PipelineRef) -> Option<Arc<[SetLayout]>>Related:
PipelineRef,SetLayoutReturns the descriptor set layouts a published pipeline's shaders declare, or
Nonewhile 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
-
fn clone(&self) -> PipelineManagerClientRelated:
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:
EntityHandleCompiles requests with shaders and pipelines read from
resourcesuntil 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
-
fn clone(&self) -> PipelineRefRelated:
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) -> boolRelated:
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>) -> SelfCreates a pose update for one renderable.
-
fn handle(&self) -> HandleReturns 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) -> UpdatePoseRelated:
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
-
fn clone(&self) -> MainRenderTargetRelated:
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
-
fn clone(&self) -> ReadFromResultRelated:
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]) -> DebugViewsRelated:
DebugViewsDeclares the debug views this pass can show, at most
MAX_VIEWS_PER_PASS, in the order the shader numbersthem 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 isRenderPass::nameor the scene pipeline manager's name. The renderer records this pass as a writer of everypool 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_PASSviews, or on a view name with a dot. -
fn create_gpu_counter(&mut self, name: &str) -> ghi::CounterHandleCreates a GPU timing counter for one stage of this node's commands, which the inspector reports as
stage.<name>next to the node's ownscene.<manager>orpass.<name>time.Wrap the stage's commands with
ghi::command_buffer::CommonCommandBufferMode::counterinside the node'srecording, 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,SceneBackgroundCreates this sink's scene background, or returns
Nonewhen the application registered none.Scene pipelines call this with their color and depth
targets. Record the result after opaque surfaces andbefore 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) -> RenderToResultRelated:
RenderToResultReturns an existing image for writing by this render pass.
-
fn create_render_target(&mut self, builder: ghi::image::Builder<'a>) -> RenderToResultRelated:
RenderToResultCreates 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) -> RenderToResultRelated:
RenderToResultCreates 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, so2gives ahalf-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_targetfor contents thatmust survive into the next frame.
-
fn create_persistent_render_target(&mut self, builder: ghi::image::Builder<'a>) -> RenderToResultRelated:
RenderToResultCreates 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::DynamicImageHandleCreates 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 anattachment, 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_frameand 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>) -> MainRenderTargetRelated:
MainRenderTargetCreates 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
maininto the replacement, so later passes readthe image this pass would have transformed.
-
fn read_from(&mut self, name: &'a str) -> ReadFromResultRelated:
ReadFromResult -
fn context(&mut self) -> &mut ghi::implementation::Context -
fn pipeline_manager(&self) -> &crate::rendering::PipelineManagerClientRelated:
PipelineManagerClientReturns 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
-
fn clone(&self) -> RenderToResultRelated:
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::DescriptorSetHandleReturns the set the writes target.
-
fn slot(&self, name: &str) -> ghi::ResourceSlotReturns 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::DescriptorWriteBinds a buffer.
-
fn image(&self, name: &str, image: impl Into<ghi::BaseImageHandle>) -> ghi::DescriptorWriteBinds a storage image a shader loads or stores.
-
fn image_element(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, index: u32) -> ghi::DescriptorWriteBinds 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::DescriptorWriteBinds a texture a shader samples through
sampler. -
fn sampled_with_frame(&self, name: &str, image: ghi::DynamicImageHandle, sampler: ghi::SamplerHandle, frame_offset: i32) -> ghi::DescriptorWriteBinds the copy of a per-frame texture that belongs to a relative frame, such as
-1for the previous frame. -
fn sampled_element(&self, name: &str, image: impl Into<ghi::BaseImageHandle>, sampler: ghi::SamplerHandle, index: u32) -> ghi::DescriptorWriteBinds 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) -> SelfBuilds the layout a baked shader declares.
-
fn from_layers(layers: &[(&str, &str)]) -> SelfBuilds the layout the last of
layersdeclares. 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:
SetLayoutReturns each distinct layout of
setsonce, in first-seen order, with the bindings any of its copies usesmarked as used.
A pipeline's stages each declare the layouts they list; this is the pipeline's view of them.
-
fn layout(&self) -> &ghi::DescriptorSetLayoutReturns the GHI layout, which descriptor sets are created from and shaders declare.
-
fn interface(&self) -> &SetInterfaceReturns the layout's bindings, with the names BESL gives them.
-
fn slot(&self, name: &str) -> ghi::ResourceSlotReturns 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::DescriptorSetHandleCreates an empty descriptor set for this layout. Next, write its resources through
Self::binder. -
fn binder(&self, set: ghi::DescriptorSetHandle) -> SetBinder<'_>Related:
SetBinderReturns 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) -> SetLayoutRelated:
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) -> SelfRelated:
ViewCreates a sink with neutral exposure for render passes that target a specific view and extent.
Next, call
Self::with_exposure_scalewhen the view comes from acrate::rendering::Camera. -
fn with_exposure_scale(self, exposure_scale: f32) -> SelfSets the camera exposure as a linear factor, as returned by
crate::rendering::Camera::exposure_scale. -
fn with_frame_interval(self, frame_interval: MediaTime) -> SelfRelated:
MediaTimeSets 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) -> ViewRelated:
ViewReturns the camera or light view used by this render target.
-
fn extent(&self) -> ExtentReturns the pixel extent available to render passes for this sink.
-
fn exposure_scale(&self) -> f32Returns 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) -> MediaTimeRelated:
MediaTimeReturns 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) -> MatrixReturns the combined projection and view matrix for shader setup.
-
fn index(&self) -> usizeReturns 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) -> SinkRelated:
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) -> SelfCreates 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) -> SelfCreates 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) -> SelfCreates an orthographic view for light, editor, or flat scene rendering.
-
fn from_view(&self, view: Matrix) -> SelfCreates a view that shares this projection but uses a caller-provided view matrix.
-
fn from_from_z_planes(&self, near: f32, far: f32) -> SelfCreates a perspective view with this view's settings and new clipping planes.
-
fn projection(&self) -> MatrixReturns the projection matrix.
-
fn view(&self) -> MatrixReturns the view matrix.
-
fn projection_view(&self) -> MatrixReturns the projection matrix multiplied by the view matrix.
-
fn view_projection(&self) -> MatrixReturns the projection matrix multiplied by the view matrix.
-
fn x_fov(&self) -> DegreesReturns the horizontal field of view derived from the vertical field of view.
-
fn y_fov(&self) -> DegreesReturns the vertical field of view used by perspective projections.
-
fn near(&self) -> f32Returns the near clipping plane distance.
-
fn far(&self) -> f32Returns the far clipping plane distance.
-
fn fov(&self) -> [f32; 2]Returns the horizontal and vertical fields of view.
-
fn aspect_ratio(&self) -> f32Returns 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) -> ViewRelated:
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) -> boolRelated:
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
-
SceneTests against the depth image produced by the active scene pipeline without changing it.
-
IgnoreDraws 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
-
fn clone(&self) -> DebugDepthModeRelated:
DebugDepthMode
impl Copy for DebugDepthMode
impl Debug for DebugDepthMode
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for DebugDepthMode
-
fn default() -> DebugDepthModeRelated:
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) -> boolRelated:
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
-
SphereA sphere centered at
centerwith a world-spaceradius. -
BoxAn oriented box whose size extends by
half_extentsfromcenter. -
CapsuleA capsule whose center line runs from
starttoend. -
SegmentA thin line segment between two world-space endpoints.
-
CircleA circle of
radiusaroundcenterin the planenormalis 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) -> DebugShapeRelated:
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) -> boolRelated:
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
-
PendingCompilation is queued or still running.
-
ReadyCompilation succeeded and published this pipeline handle.
-
FailedLoading 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
-
fn clone(&self) -> PipelineStateRelated:
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) -> boolRelated:
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
-
fn clone(&self) -> RenderPassStateRelated:
RenderPassState
impl Copy for RenderPassState
impl Debug for RenderPassState
-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Default for RenderPassState
-
fn default() -> RenderPassStateRelated:
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
-
fn eq(&self, other: &RenderPassState) -> boolRelated:
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
-
IdOne resource by ID.
-
QueryEvery 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) -> SelfNames one resource to load.
-
fn query(query: impl Into<Query>) -> SelfRelated:
QueryLoads 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) -> ResourceRelated:
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) -> boolRelated:
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 strReturns 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) -> boolReports 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) -> ViewDefined 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.