pub struct DepthPrePass {
pub enabled: bool,
pub shader_handle: u64,
pub items: Vec<u64>,
pub use_gbuffer_depth: bool,
pub rendered_count: u32,
pub time_us: u64,
pub depth_func: DepthFunction,
pub depth_write: bool,
pub alpha_test_in_prepass: bool,
pub alpha_threshold: f32,
}Expand description
Depth pre-pass that writes only depth, enabling early-Z rejection in the subsequent geometry pass.
Fields§
§enabled: boolWhether the depth pre-pass is enabled.
shader_handle: u64Shader program handle for the depth-only pass.
items: Vec<u64>Items to render in this pass (opaque, front-to-back sorted).
use_gbuffer_depth: boolWhether to use the depth from the G-Buffer or a separate depth buffer.
rendered_count: u32Statistics: number of items rendered in the pre-pass.
time_us: u64Time taken for the depth pre-pass (microseconds).
depth_func: DepthFunctionDepth function (Less, LessEqual, etc.).
depth_write: boolWhether depth writing is enabled.
alpha_test_in_prepass: boolWhether to do alpha test in the depth pre-pass (for cutout materials).
alpha_threshold: f32Alpha test threshold.
Implementations§
Source§impl DepthPrePass
impl DepthPrePass
pub fn new() -> Self
Sourcepub fn execute(&mut self, queue: &RenderQueue, _gbuffer: &mut GBuffer)
pub fn execute(&mut self, queue: &RenderQueue, _gbuffer: &mut GBuffer)
Execute the depth pre-pass using items from the render queue.
Sourcepub fn vertex_shader() -> &'static str
pub fn vertex_shader() -> &'static str
Get GLSL source for the depth-only vertex shader.
Sourcepub fn fragment_shader_alpha_test() -> &'static str
pub fn fragment_shader_alpha_test() -> &'static str
Get GLSL source for the depth-only fragment shader (alpha test variant).
Trait Implementations§
Source§impl Debug for DepthPrePass
impl Debug for DepthPrePass
Auto Trait Implementations§
impl Freeze for DepthPrePass
impl RefUnwindSafe for DepthPrePass
impl Send for DepthPrePass
impl Sync for DepthPrePass
impl Unpin for DepthPrePass
impl UnsafeUnpin for DepthPrePass
impl UnwindSafe for DepthPrePass
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.