pub struct VolumeRenderState {
pub pipeline: RenderPipeline,
pub bind_group_layout: BindGroupLayout,
pub bind_group: BindGroup,
pub params_buffer: Buffer,
pub config: VolumeConfig,
pub field_index: usize,
}Expand description
GPU state for volume rendering.
Fields§
§pipeline: RenderPipelineRender pipeline for the volume pass.
bind_group_layout: BindGroupLayoutBind group layout for recreation.
bind_group: BindGroupCurrent bind group.
params_buffer: BufferVolume parameters buffer.
config: VolumeConfigConfiguration.
field_index: usizeField index being rendered.
Implementations§
Source§impl VolumeRenderState
impl VolumeRenderState
Sourcepub fn new(
device: &Device,
field_system: &FieldSystemGpu,
config: &VolumeConfig,
surface_format: TextureFormat,
) -> Self
pub fn new( device: &Device, field_system: &FieldSystemGpu, config: &VolumeConfig, surface_format: TextureFormat, ) -> Self
Create a new volume render system.
Sourcepub fn update_bind_group(
&mut self,
device: &Device,
field_system: &FieldSystemGpu,
)
pub fn update_bind_group( &mut self, device: &Device, field_system: &FieldSystemGpu, )
Update the bind group when field buffers change (after blur swap).
Sourcepub fn update_params_with_field(
&self,
queue: &Queue,
inv_view_proj: Mat4,
camera_pos: Vec3,
field_extent: f32,
field_resolution: u32,
)
pub fn update_params_with_field( &self, queue: &Queue, inv_view_proj: Mat4, camera_pos: Vec3, field_extent: f32, field_resolution: u32, )
Update parameters with field info.
Sourcepub fn render<'a>(&'a self, render_pass: &mut RenderPass<'a>)
pub fn render<'a>(&'a self, render_pass: &mut RenderPass<'a>)
Render the volume into an existing render pass.
Call this before drawing particles for volume to appear behind them.
Auto Trait Implementations§
impl Freeze for VolumeRenderState
impl !RefUnwindSafe for VolumeRenderState
impl Send for VolumeRenderState
impl Sync for VolumeRenderState
impl Unpin for VolumeRenderState
impl !UnwindSafe for VolumeRenderState
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> 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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.