pub struct GroundPlaneRenderData { /* private fields */ }Expand description
Ground plane render resources.
Implementations§
Source§impl GroundPlaneRenderData
impl GroundPlaneRenderData
Sourcepub fn new(
device: &Device,
bind_group_layout: &BindGroupLayout,
camera_buffer: &Buffer,
light_buffer: &Buffer,
shadow_depth_view: &TextureView,
shadow_sampler: &Sampler,
) -> Self
pub fn new( device: &Device, bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, light_buffer: &Buffer, shadow_depth_view: &TextureView, shadow_sampler: &Sampler, ) -> Self
Creates new ground plane render data.
§Arguments
device- The wgpu devicebind_group_layout- The bind group layoutcamera_buffer- The camera uniform bufferlight_buffer- The light uniform buffer (fromShadowMapPass)shadow_depth_view- The shadow map depth texture viewshadow_sampler- The shadow comparison sampler
Sourcepub fn update(
&self,
queue: &Queue,
scene_center: [f32; 3],
scene_min_y: f32,
length_scale: f32,
camera_height: f32,
height_override: Option<f32>,
shadow_darkness: f32,
shadow_mode: u32,
is_orthographic: bool,
reflection_intensity: f32,
)
pub fn update( &self, queue: &Queue, scene_center: [f32; 3], scene_min_y: f32, length_scale: f32, camera_height: f32, height_override: Option<f32>, shadow_darkness: f32, shadow_mode: u32, is_orthographic: bool, reflection_intensity: f32, )
Updates the ground plane uniforms.
§Arguments
queue- The wgpu queuescene_center- Center of the scene bounding boxscene_min_y- Minimum Y coordinate of scene bounding boxlength_scale- Scene length scalecamera_height- Current camera Y positionheight_override- Optional manual height overrideshadow_darkness- Shadow darkness (0.0 = no shadow, 1.0 = full black)shadow_mode- Shadow mode: 0=none,1=shadow_only,2=tile_with_shadowis_orthographic- Whether camera is in orthographic modereflection_intensity- Reflection intensity (0.0 = opaque, 1.0 = mirror)
Sourcepub fn bind_group(&self) -> &BindGroup
pub fn bind_group(&self) -> &BindGroup
Returns the bind group for rendering.
Auto Trait Implementations§
impl Freeze for GroundPlaneRenderData
impl !RefUnwindSafe for GroundPlaneRenderData
impl Send for GroundPlaneRenderData
impl Sync for GroundPlaneRenderData
impl Unpin for GroundPlaneRenderData
impl UnsafeUnpin for GroundPlaneRenderData
impl !UnwindSafe for GroundPlaneRenderData
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