pub struct MeshLayouts {
pub model_only: BindGroupLayout,
pub lightmapped: BindGroupLayout,
pub skinned: BindGroupLayout,
pub skinned_motion: BindGroupLayout,
pub morphed: BindGroupLayout,
pub morphed_motion: BindGroupLayout,
pub morphed_skinned: BindGroupLayout,
pub morphed_skinned_motion: BindGroupLayout,
}
Expand description
All possible BindGroupLayout
s in bevy’s default mesh shader (mesh.wgsl
).
Fields§
§model_only: BindGroupLayout
The mesh model uniform (transform) and nothing else.
lightmapped: BindGroupLayout
Includes the lightmap texture and uniform.
skinned: BindGroupLayout
Also includes the uniform for skinning
skinned_motion: BindGroupLayout
Like MeshLayouts::skinned
, but includes slots for the previous
frame’s joint matrices, so that we can compute motion vectors.
morphed: BindGroupLayout
Also includes the uniform and MorphAttributes
for morph targets.
morphed_motion: BindGroupLayout
Like MeshLayouts::morphed
, but includes a slot for the previous
frame’s morph weights, so that we can compute motion vectors.
morphed_skinned: BindGroupLayout
Also includes both uniforms for skinning and morph targets, also the
morph target MorphAttributes
binding.
morphed_skinned_motion: BindGroupLayout
Like MeshLayouts::morphed_skinned
, but includes slots for the
previous frame’s joint matrices and morph weights, so that we can
compute motion vectors.
Implementations§
Source§impl MeshLayouts
impl MeshLayouts
Sourcepub fn new(render_device: &RenderDevice) -> MeshLayouts
pub fn new(render_device: &RenderDevice) -> MeshLayouts
Prepare the layouts used by the default bevy Mesh
.
pub fn model_only( &self, render_device: &RenderDevice, model: &BindingResource<'_>, ) -> BindGroup
pub fn lightmapped( &self, render_device: &RenderDevice, model: &BindingResource<'_>, lightmap: &GpuImage, ) -> BindGroup
Sourcepub fn skinned(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_skin: &Buffer,
) -> BindGroup
pub fn skinned( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_skin: &Buffer, ) -> BindGroup
Creates the bind group for skinned meshes with no morph targets.
Sourcepub fn skinned_motion(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_skin: &Buffer,
prev_skin: &Buffer,
) -> BindGroup
pub fn skinned_motion( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_skin: &Buffer, prev_skin: &Buffer, ) -> BindGroup
Creates the bind group for skinned meshes with no morph targets, with the infrastructure to compute motion vectors.
current_skin
is the buffer of joint matrices for this frame;
prev_skin
is the buffer for the previous frame. The latter is used for
motion vector computation. If there is no such applicable buffer,
current_skin
and prev_skin
will reference the same buffer.
Sourcepub fn morphed(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_weights: &Buffer,
targets: &TextureView,
) -> BindGroup
pub fn morphed( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_weights: &Buffer, targets: &TextureView, ) -> BindGroup
Creates the bind group for meshes with no skins but morph targets.
Sourcepub fn morphed_motion(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_weights: &Buffer,
targets: &TextureView,
prev_weights: &Buffer,
) -> BindGroup
pub fn morphed_motion( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_weights: &Buffer, targets: &TextureView, prev_weights: &Buffer, ) -> BindGroup
Creates the bind group for meshes with no skins but morph targets, in addition to the infrastructure to compute motion vectors.
current_weights
is the buffer of morph weights for this frame;
prev_weights
is the buffer for the previous frame. The latter is used
for motion vector computation. If there is no such applicable buffer,
current_weights
and prev_weights
will reference the same buffer.
Sourcepub fn morphed_skinned(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_skin: &Buffer,
current_weights: &Buffer,
targets: &TextureView,
) -> BindGroup
pub fn morphed_skinned( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_skin: &Buffer, current_weights: &Buffer, targets: &TextureView, ) -> BindGroup
Creates the bind group for meshes with skins and morph targets.
Sourcepub fn morphed_skinned_motion(
&self,
render_device: &RenderDevice,
model: &BindingResource<'_>,
current_skin: &Buffer,
current_weights: &Buffer,
targets: &TextureView,
prev_skin: &Buffer,
prev_weights: &Buffer,
) -> BindGroup
pub fn morphed_skinned_motion( &self, render_device: &RenderDevice, model: &BindingResource<'_>, current_skin: &Buffer, current_weights: &Buffer, targets: &TextureView, prev_skin: &Buffer, prev_weights: &Buffer, ) -> BindGroup
Creates the bind group for meshes with skins and morph targets, in addition to the infrastructure to compute motion vectors.
See the documentation for MeshLayouts::skinned_motion
and
MeshLayouts::morphed_motion
above for more information about the
current_skin
, prev_skin
, current_weights
, and prev_weights
buffers.
Trait Implementations§
Source§impl Clone for MeshLayouts
impl Clone for MeshLayouts
Source§fn clone(&self) -> MeshLayouts
fn clone(&self) -> MeshLayouts
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for MeshLayouts
impl !RefUnwindSafe for MeshLayouts
impl Send for MeshLayouts
impl Sync for MeshLayouts
impl Unpin for MeshLayouts
impl !UnwindSafe for MeshLayouts
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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