pub struct VolumeRenderer {
pub params: VolumeParams,
/* private fields */
}Expand description
Volume renderer using ray marching
Fields§
§params: VolumeParamsVolume parameters
Implementations§
Source§impl VolumeRenderer
impl VolumeRenderer
Sourcepub fn new(
device: &Device,
surface_format: TextureFormat,
camera_bind_group_layout: &BindGroupLayout,
dimensions: (usize, usize, usize),
) -> Self
pub fn new( device: &Device, surface_format: TextureFormat, camera_bind_group_layout: &BindGroupLayout, dimensions: (usize, usize, usize), ) -> Self
Create a new volume renderer
Sourcepub fn update_volume(&mut self, queue: &Queue, grid: &SimulationGrid3D)
pub fn update_volume(&mut self, queue: &Queue, grid: &SimulationGrid3D)
Update the volume texture from simulation grid
Sourcepub fn update_params(&self, queue: &Queue)
pub fn update_params(&self, queue: &Queue)
Update volume parameters
Sourcepub fn render<'a>(
&'a self,
render_pass: &mut RenderPass<'a>,
camera_bind_group: &'a BindGroup,
)
pub fn render<'a>( &'a self, render_pass: &mut RenderPass<'a>, camera_bind_group: &'a BindGroup, )
Render the volume
Sourcepub fn set_density_scale(&mut self, scale: f32)
pub fn set_density_scale(&mut self, scale: f32)
Set density scale
Sourcepub fn set_step_size(&mut self, step: f32)
pub fn set_step_size(&mut self, step: f32)
Set step size
Sourcepub fn set_threshold(&mut self, threshold: f32)
pub fn set_threshold(&mut self, threshold: f32)
Set threshold
Auto Trait Implementations§
impl Freeze for VolumeRenderer
impl !RefUnwindSafe for VolumeRenderer
impl Send for VolumeRenderer
impl Sync for VolumeRenderer
impl Unpin for VolumeRenderer
impl !UnwindSafe for VolumeRenderer
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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