pub struct RenderEngine {Show 30 fields
pub instance: Instance,
pub adapter: Adapter,
pub device: Device,
pub queue: Queue,
pub surface: Option<Surface<'static>>,
pub surface_config: SurfaceConfiguration,
pub depth_texture: Texture,
pub depth_view: TextureView,
pub materials: MaterialRegistry,
pub color_maps: ColorMapRegistry,
pub matcap_bind_group_layout: BindGroupLayout,
pub matcap_textures: HashMap<String, MatcapTextureSet>,
pub camera: Camera,
pub width: u32,
pub height: u32,
pub point_pipeline: Option<RenderPipeline>,
pub point_bind_group_layout: Option<BindGroupLayout>,
pub camera_buffer: Buffer,
pub slice_plane_buffer: Buffer,
pub slice_plane_bind_group_layout: BindGroupLayout,
pub slice_plane_bind_group: BindGroup,
pub vector_pipeline: Option<RenderPipeline>,
pub vector_bind_group_layout: Option<BindGroupLayout>,
pub mesh_pipeline: Option<RenderPipeline>,
pub mesh_depth_normal_pipeline: Option<RenderPipeline>,
pub curve_network_edge_pipeline: Option<RenderPipeline>,
pub curve_network_tube_pipeline: Option<RenderPipeline>,
pub curve_network_tube_compute_pipeline: Option<ComputePipeline>,
pub simple_mesh_pipeline: Option<RenderPipeline>,
pub gridcube_pipeline: Option<RenderPipeline>,
/* private fields */
}Expand description
The main rendering engine backed by wgpu.
Fields§
§instance: InstanceThe wgpu instance.
adapter: AdapterThe wgpu adapter.
device: DeviceThe wgpu device.
queue: QueueThe wgpu queue.
surface: Option<Surface<'static>>The render surface (None for headless).
surface_config: SurfaceConfigurationSurface configuration.
depth_texture: TextureDepth texture.
depth_view: TextureViewDepth texture view.
materials: MaterialRegistryMaterial registry.
color_maps: ColorMapRegistryColor map registry.
matcap_bind_group_layout: BindGroupLayoutMatcap bind group layout (Group 2: 4 textures + 1 sampler).
matcap_textures: HashMap<String, MatcapTextureSet>Matcap texture sets keyed by material name.
camera: CameraMain camera.
width: u32Current viewport width.
height: u32Current viewport height.
point_pipeline: Option<RenderPipeline>Point cloud render pipeline.
point_bind_group_layout: Option<BindGroupLayout>Point cloud bind group layout.
camera_buffer: BufferCamera uniform buffer.
slice_plane_buffer: BufferSlice plane uniform buffer.
slice_plane_bind_group_layout: BindGroupLayoutSlice plane bind group layout (shared by all structure shaders).
slice_plane_bind_group: BindGroupSlice plane bind group (updated each frame).
vector_pipeline: Option<RenderPipeline>Vector arrow render pipeline.
vector_bind_group_layout: Option<BindGroupLayout>Vector bind group layout.
mesh_pipeline: Option<RenderPipeline>Surface mesh render pipeline (alpha blending, depth write enabled).
mesh_depth_normal_pipeline: Option<RenderPipeline>Surface mesh depth/normal-only pipeline (Pretty mode prepass).
curve_network_edge_pipeline: Option<RenderPipeline>Curve network edge render pipeline (line rendering).
curve_network_tube_pipeline: Option<RenderPipeline>Curve network tube render pipeline (cylinder impostor rendering).
curve_network_tube_compute_pipeline: Option<ComputePipeline>Curve network tube compute pipeline (generates bounding box geometry).
simple_mesh_pipeline: Option<RenderPipeline>Simple mesh pipeline (for isosurface rendering).
gridcube_pipeline: Option<RenderPipeline>Gridcube pipeline (for volume grid scalar visualization).
Implementations§
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn assign_pick_range(
&mut self,
type_name: &str,
name: &str,
num_elements: u32,
) -> u32
pub fn assign_pick_range( &mut self, type_name: &str, name: &str, num_elements: u32, ) -> u32
Assigns a contiguous range of global pick indices to a structure.
Returns the global_start index. The structure owns indices
[global_start, global_start + num_elements).
Index 0 is reserved as background (no hit), so all ranges start from >= 1.
Sourcepub fn remove_pick_range(&mut self, type_name: &str, name: &str)
pub fn remove_pick_range(&mut self, type_name: &str, name: &str)
Removes a structure’s pick range.
The range is freed but the global index counter is not decremented (monotonic allocation — no fragmentation complexity).
Sourcepub fn lookup_global_index(
&self,
global_index: u32,
) -> Option<(&str, &str, u32)>
pub fn lookup_global_index( &self, global_index: u32, ) -> Option<(&str, &str, u32)>
Looks up which structure owns a global pick index.
Returns (type_name, name, local_element_index) or None if no structure
owns this index (background or freed range).
Sourcepub fn get_pick_range_start(&self, type_name: &str, name: &str) -> Option<u32>
pub fn get_pick_range_start(&self, type_name: &str, name: &str) -> Option<u32>
Gets the global_start for a structure’s pick range, if assigned.
Sourcepub fn init_pick_buffers(&mut self, width: u32, height: u32)
pub fn init_pick_buffers(&mut self, width: u32, height: u32)
Creates or recreates pick buffer textures to match viewport size.
Sourcepub fn pick_bind_group_layout(&self) -> &BindGroupLayout
pub fn pick_bind_group_layout(&self) -> &BindGroupLayout
Gets the pick bind group layout.
Sourcepub fn point_pick_pipeline(&self) -> &RenderPipeline
pub fn point_pick_pipeline(&self) -> &RenderPipeline
Gets the point cloud pick pipeline.
Sourcepub fn curve_network_pick_pipeline(&self) -> &RenderPipeline
pub fn curve_network_pick_pipeline(&self) -> &RenderPipeline
Gets the curve network pick pipeline.
Sourcepub fn init_curve_network_pick_pipeline(&mut self)
pub fn init_curve_network_pick_pipeline(&mut self)
Initializes the curve network pick pipeline.
Sourcepub fn has_curve_network_pick_pipeline(&self) -> bool
pub fn has_curve_network_pick_pipeline(&self) -> bool
Returns whether the curve network pick pipeline is initialized.
Sourcepub fn init_curve_network_tube_pick_pipeline(&mut self)
pub fn init_curve_network_tube_pick_pipeline(&mut self)
Initializes the curve network tube pick pipeline (uses ray-cylinder intersection).
Sourcepub fn has_curve_network_tube_pick_pipeline(&self) -> bool
pub fn has_curve_network_tube_pick_pipeline(&self) -> bool
Returns whether the curve network tube pick pipeline is initialized.
Sourcepub fn curve_network_tube_pick_pipeline(&self) -> &RenderPipeline
pub fn curve_network_tube_pick_pipeline(&self) -> &RenderPipeline
Gets the curve network tube pick pipeline.
Sourcepub fn curve_network_tube_pick_bind_group_layout(&self) -> &BindGroupLayout
pub fn curve_network_tube_pick_bind_group_layout(&self) -> &BindGroupLayout
Gets the curve network tube pick bind group layout.
Sourcepub fn init_mesh_pick_pipeline(&mut self)
pub fn init_mesh_pick_pipeline(&mut self)
Initializes the mesh pick pipeline for surface meshes.
Sourcepub fn has_mesh_pick_pipeline(&self) -> bool
pub fn has_mesh_pick_pipeline(&self) -> bool
Returns whether the mesh pick pipeline is initialized.
Sourcepub fn mesh_pick_pipeline(&self) -> &RenderPipeline
pub fn mesh_pick_pipeline(&self) -> &RenderPipeline
Gets the mesh pick pipeline.
Sourcepub fn mesh_pick_bind_group_layout(&self) -> &BindGroupLayout
pub fn mesh_pick_bind_group_layout(&self) -> &BindGroupLayout
Gets the mesh pick bind group layout.
Sourcepub fn init_gridcube_pick_pipeline(&mut self)
pub fn init_gridcube_pick_pipeline(&mut self)
Initializes the gridcube pick pipeline for volume grid instances.
Sourcepub fn has_gridcube_pick_pipeline(&self) -> bool
pub fn has_gridcube_pick_pipeline(&self) -> bool
Returns whether the gridcube pick pipeline is initialized.
Sourcepub fn gridcube_pick_pipeline(&self) -> &RenderPipeline
pub fn gridcube_pick_pipeline(&self) -> &RenderPipeline
Gets the gridcube pick pipeline.
Sourcepub fn gridcube_pick_bind_group_layout(&self) -> &BindGroupLayout
pub fn gridcube_pick_bind_group_layout(&self) -> &BindGroupLayout
Gets the gridcube pick bind group layout.
Sourcepub fn pick_at(&self, x: u32, y: u32) -> Option<u32>
pub fn pick_at(&self, x: u32, y: u32) -> Option<u32>
Reads the pick buffer at (x, y) and returns the decoded global index.
Returns None if picking system not initialized or coordinates out of bounds. Returns Some(0) for background clicks.
Sourcepub fn pick_texture_view(&self) -> Option<&TextureView>
pub fn pick_texture_view(&self) -> Option<&TextureView>
Returns the pick texture view for external rendering.
Sourcepub fn pick_depth_view(&self) -> Option<&TextureView>
pub fn pick_depth_view(&self) -> Option<&TextureView>
Returns the pick depth texture view for external rendering.
Sourcepub fn begin_pick_pass<'a>(
&'a self,
encoder: &'a mut CommandEncoder,
) -> Option<RenderPass<'a>>
pub fn begin_pick_pass<'a>( &'a self, encoder: &'a mut CommandEncoder, ) -> Option<RenderPass<'a>>
Begins a pick render pass. Returns the render pass encoder.
The caller is responsible for rendering structures to this pass and then dropping the encoder to finish the pass.
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn shadow_pipeline(&self) -> Option<&RenderPipeline>
pub fn shadow_pipeline(&self) -> Option<&RenderPipeline>
Gets the shadow render pipeline.
Sourcepub fn shadow_bind_group_layout(&self) -> Option<&BindGroupLayout>
pub fn shadow_bind_group_layout(&self) -> Option<&BindGroupLayout>
Gets the shadow bind group layout.
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn init_point_pipeline(&mut self)
pub fn init_point_pipeline(&mut self)
Initializes the point cloud render pipeline.
Sourcepub fn point_bind_group_layout(&self) -> &BindGroupLayout
pub fn point_bind_group_layout(&self) -> &BindGroupLayout
Gets the point cloud bind group layout.
Sourcepub fn init_vector_pipeline(&mut self)
pub fn init_vector_pipeline(&mut self)
Initializes the vector arrow render pipeline.
Sourcepub fn vector_bind_group_layout(&self) -> &BindGroupLayout
pub fn vector_bind_group_layout(&self) -> &BindGroupLayout
Gets the vector bind group layout.
Sourcepub fn mesh_bind_group_layout(&self) -> &BindGroupLayout
pub fn mesh_bind_group_layout(&self) -> &BindGroupLayout
Gets the mesh bind group layout.
Sourcepub fn simple_mesh_bind_group_layout(&self) -> &BindGroupLayout
pub fn simple_mesh_bind_group_layout(&self) -> &BindGroupLayout
Gets the simple mesh bind group layout (for isosurface rendering).
Sourcepub fn curve_network_edge_bind_group_layout(&self) -> &BindGroupLayout
pub fn curve_network_edge_bind_group_layout(&self) -> &BindGroupLayout
Gets the curve network edge bind group layout.
Sourcepub fn curve_network_tube_bind_group_layout(&self) -> &BindGroupLayout
pub fn curve_network_tube_bind_group_layout(&self) -> &BindGroupLayout
Gets the curve network tube render bind group layout.
Sourcepub fn curve_network_tube_compute_bind_group_layout(&self) -> &BindGroupLayout
pub fn curve_network_tube_compute_bind_group_layout(&self) -> &BindGroupLayout
Gets the curve network tube compute bind group layout.
Sourcepub fn curve_network_tube_compute_pipeline(&self) -> &ComputePipeline
pub fn curve_network_tube_compute_pipeline(&self) -> &ComputePipeline
Gets the curve network tube compute pipeline.
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn gridcube_bind_group_layout(&self) -> &BindGroupLayout
pub fn gridcube_bind_group_layout(&self) -> &BindGroupLayout
Gets the gridcube bind group layout (for volume grid cube rendering).
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn create_screenshot_target(&mut self) -> TextureView
pub fn create_screenshot_target(&mut self) -> TextureView
Creates a screenshot texture for capturing frames.
Returns a texture view (HDR format) that can be used as a render target.
The pipelines render to HDR format, so we need an HDR texture for rendering,
then tone map to the final screenshot texture.
After rendering to this view, call apply_screenshot_tone_mapping() then
capture_screenshot() to get the pixel data.
Sourcepub fn screenshot_texture_view(&self) -> Option<TextureView>
pub fn screenshot_texture_view(&self) -> Option<TextureView>
Returns the screenshot texture view (for tone mapping output).
Sourcepub fn apply_screenshot_tone_mapping(&mut self, encoder: &mut CommandEncoder)
pub fn apply_screenshot_tone_mapping(&mut self, encoder: &mut CommandEncoder)
Applies tone mapping from the screenshot HDR texture to the final screenshot texture.
Sourcepub fn screenshot_depth_view(&self) -> &TextureView
pub fn screenshot_depth_view(&self) -> &TextureView
Returns the screenshot depth view for rendering.
Sourcepub fn capture_screenshot(&mut self) -> Result<Vec<u8>, ScreenshotError>
pub fn capture_screenshot(&mut self) -> Result<Vec<u8>, ScreenshotError>
Captures the screenshot after rendering to the screenshot target.
This method copies the screenshot texture to a buffer and reads it back.
Call this after rendering to the view returned by create_screenshot_target().
Returns the raw RGBA pixel data.
Sourcepub fn ssaa_factor(&self) -> u32
pub fn ssaa_factor(&self) -> u32
Returns the current SSAA factor (1 = off, 2 = 2x, 4 = 4x).
Sourcepub fn set_ssaa_factor(&mut self, factor: u32)
pub fn set_ssaa_factor(&mut self, factor: u32)
Sets the SSAA factor and recreates render textures at the new resolution. Valid values are 1 (off), 2 (2x supersampling), or 4 (4x supersampling).
Sourcepub fn ensure_depth_peel_pass(&mut self)
pub fn ensure_depth_peel_pass(&mut self)
Ensures the depth peel pass is initialized and matches render resolution.
Sourcepub fn depth_peel_pass(&self) -> Option<&DepthPeelPass>
pub fn depth_peel_pass(&self) -> Option<&DepthPeelPass>
Returns the depth peel pass, if initialized.
Sourcepub fn depth_peel_pass_mut(&mut self) -> Option<&mut DepthPeelPass>
pub fn depth_peel_pass_mut(&mut self) -> Option<&mut DepthPeelPass>
Returns a mutable reference to the depth peel pass, if initialized.
Sourcepub fn hdr_view(&self) -> Option<&TextureView>
pub fn hdr_view(&self) -> Option<&TextureView>
Returns the HDR texture view for rendering the scene.
Sourcepub fn normal_view(&self) -> Option<&TextureView>
pub fn normal_view(&self) -> Option<&TextureView>
Returns the normal G-buffer view if available.
Sourcepub fn ssao_noise_view(&self) -> Option<&TextureView>
pub fn ssao_noise_view(&self) -> Option<&TextureView>
Returns the SSAO noise texture view if available.
Sourcepub fn ssao_output_view(&self) -> Option<&TextureView>
pub fn ssao_output_view(&self) -> Option<&TextureView>
Returns the SSAO output texture view if available.
Sourcepub fn render_ssao(
&self,
encoder: &mut CommandEncoder,
config: &SsaoConfig,
) -> bool
pub fn render_ssao( &self, encoder: &mut CommandEncoder, config: &SsaoConfig, ) -> bool
Renders the SSAO pass. Returns true if SSAO was rendered, false if resources are not available.
Sourcepub fn tone_map_pass(&self) -> Option<&ToneMapPass>
pub fn tone_map_pass(&self) -> Option<&ToneMapPass>
Returns the tone map pass.
Sourcepub fn update_tone_mapping(
&self,
exposure: f32,
white_level: f32,
gamma: f32,
ssao_enabled: bool,
)
pub fn update_tone_mapping( &self, exposure: f32, white_level: f32, gamma: f32, ssao_enabled: bool, )
Updates tone mapping uniforms.
Sourcepub fn render_tone_mapping(
&self,
encoder: &mut CommandEncoder,
output_view: &TextureView,
)
pub fn render_tone_mapping( &self, encoder: &mut CommandEncoder, output_view: &TextureView, )
Renders the tone mapping pass from HDR to the output view. Uses SSAO texture if available, otherwise uses a default white texture.
When SSAA is enabled (factor > 1):
- Downsamples HDR (SSAA res) → intermediate HDR (screen res)
- Tone maps intermediate HDR → output LDR (SSAO disabled — resolution mismatch)
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn default_matcap_bind_group(&self) -> &BindGroup
pub fn default_matcap_bind_group(&self) -> &BindGroup
Returns the matcap bind group for the default material (“clay”).
Sourcepub fn matcap_bind_group_for(&self, material_name: &str) -> &BindGroup
pub fn matcap_bind_group_for(&self, material_name: &str) -> &BindGroup
Returns the matcap bind group for a given material name. Falls back to the default material if the name is not found.
Sourcepub fn render_ground_plane(
&mut self,
encoder: &mut CommandEncoder,
surface_view: &TextureView,
enabled: bool,
scene_center: [f32; 3],
scene_min_y: f32,
length_scale: f32,
height_override: Option<f32>,
shadow_darkness: f32,
shadow_mode: u32,
reflection_intensity: f32,
)
pub fn render_ground_plane( &mut self, encoder: &mut CommandEncoder, surface_view: &TextureView, enabled: bool, scene_center: [f32; 3], scene_min_y: f32, length_scale: f32, height_override: Option<f32>, shadow_darkness: f32, shadow_mode: u32, reflection_intensity: f32, )
Renders the ground plane.
§Arguments
encoder- The command encoderview- The render target viewenabled- Whether the ground plane is enabledscene_center- Center of the scene bounding boxscene_min_y- Minimum Y coordinate of scene bounding boxlength_scale- Scene length scaleheight_override- Optional manual height (None = auto below scene)shadow_darkness- Shadow darkness (0.0 = no shadow, 1.0 = full black)shadow_mode- Shadow mode: 0=none,1=shadow_only,2=tile_with_shadowreflection_intensity- Reflection intensity (0.0 = opaque, affects transparency)
Sourcepub fn render_slice_planes(
&mut self,
encoder: &mut CommandEncoder,
planes: &[SlicePlane],
length_scale: f32,
)
pub fn render_slice_planes( &mut self, encoder: &mut CommandEncoder, planes: &[SlicePlane], length_scale: f32, )
Renders slice plane visualizations.
Renders enabled slice planes as semi-transparent grids. Should be called after rendering structures, before tone mapping.
Sourcepub fn render_slice_planes_with_clear(
&mut self,
encoder: &mut CommandEncoder,
planes: &[SlicePlane],
length_scale: f32,
clear_color: [f32; 3],
)
pub fn render_slice_planes_with_clear( &mut self, encoder: &mut CommandEncoder, planes: &[SlicePlane], length_scale: f32, clear_color: [f32; 3], )
Renders slice plane visualizations with clearing.
Clears the HDR texture and depth buffer first, then renders slice planes. This should be called BEFORE rendering scene geometry so that geometry can properly occlude the slice planes.
Sourcepub fn render_stencil_pass(
&mut self,
encoder: &mut CommandEncoder,
color_view: &TextureView,
ground_height: f32,
scene_center: [f32; 3],
length_scale: f32,
)
pub fn render_stencil_pass( &mut self, encoder: &mut CommandEncoder, color_view: &TextureView, ground_height: f32, scene_center: [f32; 3], length_scale: f32, )
Renders the ground plane to the stencil buffer for reflection masking.
This should be called before rendering reflected geometry. The stencil buffer will have value 1 where the ground plane is visible.
Sourcepub fn reflection_pass(&self) -> Option<&ReflectionPass>
pub fn reflection_pass(&self) -> Option<&ReflectionPass>
Returns the reflection pass.
Sourcepub fn update_reflection(
&self,
reflection_matrix: Mat4,
intensity: f32,
ground_height: f32,
)
pub fn update_reflection( &self, reflection_matrix: Mat4, intensity: f32, ground_height: f32, )
Updates reflection uniforms.
Sourcepub fn create_reflected_mesh_bind_group(
&self,
mesh_render_data: &SurfaceMeshRenderData,
) -> Option<BindGroup>
pub fn create_reflected_mesh_bind_group( &self, mesh_render_data: &SurfaceMeshRenderData, ) -> Option<BindGroup>
Creates a bind group for reflected mesh rendering.
Sourcepub fn render_reflected_mesh(
&self,
render_pass: &mut RenderPass<'_>,
mesh_bind_group: &BindGroup,
vertex_count: u32,
material_name: &str,
)
pub fn render_reflected_mesh( &self, render_pass: &mut RenderPass<'_>, mesh_bind_group: &BindGroup, vertex_count: u32, material_name: &str, )
Renders a single reflected mesh.
Call this for each visible surface mesh after render_stencil_pass.
Sourcepub fn create_reflected_point_cloud_bind_group(
&self,
point_render_data: &PointCloudRenderData,
) -> Option<BindGroup>
pub fn create_reflected_point_cloud_bind_group( &self, point_render_data: &PointCloudRenderData, ) -> Option<BindGroup>
Creates a bind group for reflected point cloud rendering.
Sourcepub fn render_reflected_point_cloud(
&self,
render_pass: &mut RenderPass<'_>,
point_bind_group: &BindGroup,
point_count: u32,
material_name: &str,
)
pub fn render_reflected_point_cloud( &self, render_pass: &mut RenderPass<'_>, point_bind_group: &BindGroup, point_count: u32, material_name: &str, )
Renders a single reflected point cloud.
Sourcepub fn create_reflected_curve_network_bind_group(
&self,
curve_render_data: &CurveNetworkRenderData,
) -> Option<BindGroup>
pub fn create_reflected_curve_network_bind_group( &self, curve_render_data: &CurveNetworkRenderData, ) -> Option<BindGroup>
Creates a bind group for reflected curve network rendering.
Sourcepub fn render_reflected_curve_network(
&self,
render_pass: &mut RenderPass<'_>,
curve_bind_group: &BindGroup,
curve_render_data: &CurveNetworkRenderData,
material_name: &str,
)
pub fn render_reflected_curve_network( &self, render_pass: &mut RenderPass<'_>, curve_bind_group: &BindGroup, curve_render_data: &CurveNetworkRenderData, material_name: &str, )
Renders a single reflected curve network (tube mode).
Source§impl RenderEngine
impl RenderEngine
Sourcepub fn create_normal_texture_with_size(&mut self, width: u32, height: u32)
pub fn create_normal_texture_with_size(&mut self, width: u32, height: u32)
Creates normal G-buffer texture at specified size.
Source§impl RenderEngine
impl RenderEngine
Sourcepub async fn new_windowed(window: Arc<Window>) -> RenderResult<Self>
pub async fn new_windowed(window: Arc<Window>) -> RenderResult<Self>
Creates a new windowed render engine.
Sourcepub async fn new_headless(width: u32, height: u32) -> RenderResult<Self>
pub async fn new_headless(width: u32, height: u32) -> RenderResult<Self>
Creates a new headless render engine.
Sourcepub fn update_camera_uniforms(&self)
pub fn update_camera_uniforms(&self)
Updates camera uniforms.
Sourcepub fn update_slice_plane_uniforms(
&self,
planes: impl Iterator<Item = SlicePlaneUniforms>,
)
pub fn update_slice_plane_uniforms( &self, planes: impl Iterator<Item = SlicePlaneUniforms>, )
Updates slice plane uniforms from the provided slice plane data.
Takes an iterator of SlicePlaneUniforms and uploads them to the GPU buffer.
Up to MAX_SLICE_PLANES planes are used; remaining slots are disabled.
Sourcepub fn camera_buffer(&self) -> &Buffer
pub fn camera_buffer(&self) -> &Buffer
Gets the camera buffer.
Sourcepub fn shadow_map_pass(&self) -> Option<&ShadowMapPass>
pub fn shadow_map_pass(&self) -> Option<&ShadowMapPass>
Gets the shadow map pass (if initialized).
Sourcepub fn depth_view(&self) -> &TextureView
pub fn depth_view(&self) -> &TextureView
Returns the depth texture view.
Sourcepub fn hdr_texture_view(&self) -> Option<&TextureView>
pub fn hdr_texture_view(&self) -> Option<&TextureView>
Returns the HDR texture view if available.
Sourcepub fn dimensions(&self) -> (u32, u32)
pub fn dimensions(&self) -> (u32, u32)
Returns the viewport dimensions.
Sourcepub fn render_dimensions(&self) -> (u32, u32)
pub fn render_dimensions(&self) -> (u32, u32)
Returns the render dimensions (accounting for SSAA).
Sourcepub fn load_blendable_material(
&mut self,
name: &str,
filenames: [&str; 4],
) -> Result<(), PolyscopeError>
pub fn load_blendable_material( &mut self, name: &str, filenames: [&str; 4], ) -> Result<(), PolyscopeError>
Loads a blendable (4-channel RGB-tintable) material from disk.
Takes 4 image file paths for R, G, B, K matcap channels.
Supports HDR, JPEG, PNG, EXR, and other formats via the image crate.
Sourcepub fn load_static_material(
&mut self,
name: &str,
filename: &str,
) -> Result<(), PolyscopeError>
pub fn load_static_material( &mut self, name: &str, filename: &str, ) -> Result<(), PolyscopeError>
Loads a static (single-texture, non-RGB-tintable) material from disk.
The same texture is used for all 4 matcap channels.
Supports HDR, JPEG, PNG, EXR, and other formats via the image crate.
Auto Trait Implementations§
impl !Freeze for RenderEngine
impl !RefUnwindSafe for RenderEngine
impl Send for RenderEngine
impl Sync for RenderEngine
impl Unpin for RenderEngine
impl UnsafeUnpin for RenderEngine
impl !UnwindSafe for RenderEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more