Expand description
Rerun’s renderer.
A wgpu based renderer wgpu for all your visualization needs.
Used in re_runner to display the contents of any view contents other than pure UI.
§Feature flags
import-obj(enabled by default) — Support importing .obj filesimport-gltf(enabled by default) — Support importing .gltf and .glb filesimport-stl(enabled by default) — Support importing binary & ascii .stl filesserde— Enable (de)serialization using serde.
§Draw recording overview
ViewBuilder are the main entry point for all draw operations.
Each ViewBuilder represents a rectangular screen area that is composited into the target surface
via ViewBuilder::composite.
A user supplies renderer::DrawDatas to the ViewBuilder.
Upon submission, the ViewBuilder collects the Drawables from the QueueableDrawData and
adds them to the appropriate work queues of each draw phase.
Drawables map roughly 1:1 to wgpu draw calls and have a renderer::DrawData type specific payload
that identifies them within their renderer::DrawData.
Depending on the DrawPhase sorting of drawables may occur:
for instance DrawPhase::Transparent sorts far to near to facilitate blending, whereas other phases aggressively
bundle by renderer::DrawData types to minimize state changes.
Each renderer::DrawData is associated with a single renderer::Renderer.
These encapsulate the knowledge (i.e. renderpipelines etc.) of how to render a certain kind of primitive.
Unlike renderer::DrawDatas, renderer::Renderers are immutable and long-lived.
Re-exports§
pub use importer::CpuMeshInstance;pub use importer::CpuModel;pub use importer::CpuModelMeshKey;pub use texture_info::Texture2DBufferInfo;pub use view_builder::RenderMode;pub use view_builder::ViewBuilder;pub use view_builder::ViewPickingConfiguration;
Modules§
- device_
caps - external
- importer
- mesh
- renderer
- resource_
managers - Resource managers are concerned with mapping (typically) higher level user data to their Gpu representation.
- texture_
info - video
- view_
builder - wgpu_
buffer_ types - Explicitly padded and/or aligned types following wgsl rules. See wgsl spec on alignment and size
Macros§
- include_
file - include_
shader_ module - Create a shader module using the
include_file!macro and set the path name as debug string.
Structs§
- Bind
Group Desc - Bind
Group Layout Desc - Color32
- This format is used for space-efficient color representation (32 bits).
- Debug
Label - Label for resources. Optimized out in release builds.
- Draw
Phase Manager - Manages the drawables for all active phases.
- Drawable
- A single drawable item within a given
crate::renderer::DrawData. - Drawable
Collector - Collector injected into
crate::renderer::DrawData::collect_drawablesin order to build up drawable list. - File
Resolver - The
FileResolverhandles both resolving import clauses and doing the actual string interpolation. - File
Server - A noop implementation of a
FileServer. - Global
Bindings - Global bindings which are always available on bind group 0 for all
crate::renderer::Renderer. - GpuBind
Group - A reference-counter baked bind group.
- GpuBind
Group Layout Handle - GpuPipeline
Layout Pool - GpuRender
Pipeline Handle - GpuRender
Pipeline Pool - GpuShader
Module Handle - GpuShader
Module Pool - Hsva
- Hue, saturation, value, alpha. All in the range [0, 1]. No premultiplied alpha.
- Import
Clause - A pre-parsed import clause, as in
#import <something>. - Line
Batch Builder - Line
Drawable Builder - Builder for a vector of line strips, making it easy to create
crate::renderer::LineDrawData. - Line
Strip Builder - Outline
Config - Outline
Mask Preference - What outline (if any) should be drawn.
- Outline
Mask Processor - Picking
Layer Id - Combination of
PickingLayerObjectIdandPickingLayerInstanceId. - Picking
Layer Instance Id - The second 64bit of the picking layer.
- Picking
Layer Object Id - The first 64bit of the picking layer.
- Picking
Layer Processor - Manages the rendering of the picking layer pass, its render targets & readback buffer.
- Pipeline
Layout Desc - Point
Cloud Batch Builder - Point
Cloud Builder - Builder for point clouds, making it easy to create
crate::renderer::PointCloudDrawData. - Queueable
Draw Data - Type erased draw data that can be submitted directly to the view builder.
- RectF32
- A 2D rectangle with float coordinates.
- RectInt
- A 2D rectangle with integer coordinates.
- Rect
Transform - Defines a transformation from a rectangular region of interest into a rectangular target region.
- Render
Config - Configures global properties of the renderer.
- Render
Context - Any resource involving wgpu rendering which can be re-used across different scenes. I.e. render pipelines, resource pools, etc.
- Render
Pipeline Desc - Renderpipeline descriptor, can be converted into
wgpu::RenderPipeline(which isn’t hashable or comparable) - Renderer
Type Id - Unique identifier for a
Renderertype. - Rgba
- 0-1 linear space
RGBAcolor with premultiplied alpha. - Rgba32
Unmul - RGBA color in sRGB gamma space, with separate/unmultiplied linear alpha.
- Screenshot
Processor - Search
Path - Specifies where to look for imports when both absolute and relative resolution fail.
- Shader
Module Desc - Size
- A size of something in either scene units or ui points.
- Unaligned
Color32 ecolor::Color32but withoutrepr(align(4)), since that is not compatible withrepr(packed).- Vertex
Buffer Layout - A copy of
wgpu::VertexBufferLayoutwith asmallvecfor the attributes. - Wgpu
Resource Pool Statistics
Enums§
- Bind
Group Entry - Colormap
- CpuWrite
GpuRead Error - Draw
Phase - Determines a (very rough) order of rendering and describes the active
wgpu::RenderPass. - Msaa
Mode - Controls MSAA (Multi-Sampling Anti-Aliasing)
- Render
Context Error
Traits§
- File
System - A very limited filesystem, just enough for our internal needs.
Functions§
- adapter_
info_ summary - A human-readable summary about an adapter
- colormap_
cyan_ to_ yellow_ srgb - Returns a gamma-space sRGB in 0-255 range.
- colormap_
inferno_ srgb - Returns sRGB polynomial approximation from Inferno color map, assuming
tis normalized. - colormap_
magma_ srgb - Returns sRGB polynomial approximation from Magma color map, assuming
tis normalized. - colormap_
plasma_ srgb - Returns sRGB polynomial approximation from Plasma color map, assuming
tis normalized. - colormap_
srgb - colormap_
turbo_ srgb - Returns sRGB polynomial approximation from Turbo color map, assuming
tis normalized. - colormap_
viridis_ srgb - Returns sRGB polynomial approximation from Viridis color map, assuming
tis normalized. - create_
and_ fill_ uniform_ buffer - See
create_and_fill_uniform_buffer. - create_
and_ fill_ uniform_ buffer_ batch - Utility for fast & efficient creation of uniform buffers from a series of structs.
- get_
filesystem - Returns the recommended filesystem handle for the current platform.
- grayscale_
srgb - Returns an sRGB gray value, assuming
tis normalized. - new_
recommended_ file_ resolver - Returns the recommended
FileResolverfor the current platform/target. - pad_
rgb_ to_ rgba - Pad
RGBtoRGBAwith the given alpha.
Type Aliases§
- Depth
Offset - Depth offset used to resolve z-fighting between 2D primitives.
- GpuReadback
Identifier - Identifier used to identify a buffer upon retrieval of the data.
- GpuRender
Pipeline Pool Accessor - Recommended
File Resolver - The recommended
FileResolvertype for the current platform/target.