pub struct DepthPeelPass { /* private fields */ }Expand description
Resources for the depth peeling transparency system.
Implementations§
Source§impl DepthPeelPass
impl DepthPeelPass
Sourcepub fn new(
device: &Device,
width: u32,
height: u32,
mesh_bind_group_layout: &BindGroupLayout,
slice_plane_bind_group_layout: &BindGroupLayout,
matcap_bind_group_layout: &BindGroupLayout,
) -> Self
pub fn new( device: &Device, width: u32, height: u32, mesh_bind_group_layout: &BindGroupLayout, slice_plane_bind_group_layout: &BindGroupLayout, matcap_bind_group_layout: &BindGroupLayout, ) -> Self
Creates a new depth peel pass with all required resources.
Sourcepub fn resize(&mut self, device: &Device, width: u32, height: u32)
pub fn resize(&mut self, device: &Device, width: u32, height: u32)
Resizes all textures. Call when window size changes.
Sourcepub fn peel_pipeline(&self) -> &RenderPipeline
pub fn peel_pipeline(&self) -> &RenderPipeline
Returns the peel pipeline for external use.
Sourcepub fn peel_bind_group(&self) -> &BindGroup
pub fn peel_bind_group(&self) -> &BindGroup
Returns the peel bind group (Group 3 for min-depth texture).
Sourcepub fn peel_color_view(&self) -> &TextureView
pub fn peel_color_view(&self) -> &TextureView
Returns the peel color view (render target for each peel pass).
Sourcepub fn peel_depth_color_view(&self) -> &TextureView
pub fn peel_depth_color_view(&self) -> &TextureView
Returns the peel depth color view (depth-as-color output).
Sourcepub fn peel_depth_view(&self) -> &TextureView
pub fn peel_depth_view(&self) -> &TextureView
Returns the peel depth view (actual depth buffer).
Sourcepub fn min_depth_view(&self) -> &TextureView
pub fn min_depth_view(&self) -> &TextureView
Returns the min-depth view.
Sourcepub fn final_view(&self) -> &TextureView
pub fn final_view(&self) -> &TextureView
Returns the final accumulated view.
Sourcepub fn composite_layer(&self, encoder: &mut CommandEncoder, device: &Device)
pub fn composite_layer(&self, encoder: &mut CommandEncoder, device: &Device)
Composites the current peel layer into the final buffer using alpha-under blending.
Sourcepub fn update_min_depth(&self, encoder: &mut CommandEncoder, device: &Device)
pub fn update_min_depth(&self, encoder: &mut CommandEncoder, device: &Device)
Updates the min-depth texture from the current peel’s depth-as-color output. Uses Max blend to keep the furthest depth seen so far.
Sourcepub fn composite_final_to_scene(
&self,
encoder: &mut CommandEncoder,
device: &Device,
hdr_view: &TextureView,
)
pub fn composite_final_to_scene( &self, encoder: &mut CommandEncoder, device: &Device, hdr_view: &TextureView, )
Composites the final peeled result onto the HDR scene buffer.
Auto Trait Implementations§
impl Freeze for DepthPeelPass
impl !RefUnwindSafe for DepthPeelPass
impl Send for DepthPeelPass
impl Sync for DepthPeelPass
impl Unpin for DepthPeelPass
impl !UnwindSafe for DepthPeelPass
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