pub struct ParallaxMaterialUniform {
pub base_color: Vec4,
pub emissive: Vec4,
pub roughness: f32,
pub metallic: f32,
pub reflectance: f32,
pub flags: u32,
pub alpha_cutoff: f32,
pub height_depth: f32,
pub max_height_layers: f32,
}Expand description
The GPU representation of the uniform data of a ParallaxMaterial.
Fields§
§base_color: Vec4Doubles as diffuse albedo for non-metallic, specular for metallic and a mix for everything in between.
emissive: Vec4Use a color for user friendliness even though we technically don’t use the alpha channel Might be used in the future for exposure correction in HDR
roughness: f32Linear perceptual roughness, clamped to [0.089, 1.0] in the shader Defaults to minimum of 0.089
metallic: f32From [0.0, 1.0], dielectric to pure metallic
reflectance: f32Specular intensity for non-metals on a linear scale of [0.0, 1.0] defaults to 0.5 which is mapped to 4% reflectance in the shader
flags: u32The shader flags.
alpha_cutoff: f32When the alpha mode mask flag is set, any base color alpha above this cutoff means fully opaque, and any below means fully transparent.
height_depth: f32The depth of the height map.
max_height_layers: f32In how many layers to split the height maps for Steep parallax mapping.
If your height_depth is >0.1 and you are seeing jaggy edges,
increase this value. However, this incures a performance cost.
Trait Implementations§
Source§impl AsBindGroupShaderType<ParallaxMaterialUniform> for ParallaxMaterial
impl AsBindGroupShaderType<ParallaxMaterialUniform> for ParallaxMaterial
Source§fn as_bind_group_shader_type(
&self,
images: &RenderAssets<Image>,
) -> ParallaxMaterialUniform
fn as_bind_group_shader_type( &self, images: &RenderAssets<Image>, ) -> ParallaxMaterialUniform
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl Clone for ParallaxMaterialUniform
impl Clone for ParallaxMaterialUniform
Source§fn clone(&self) -> ParallaxMaterialUniform
fn clone(&self) -> ParallaxMaterialUniform
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl CreateFrom for ParallaxMaterialUniformwhere
Self: ShaderType<ExtraMetadata = StructMetadata<9usize>>,
for<'__, '__> Vec4: CreateFrom,
for<'__, '__, '__, '__, '__, '__> f32: CreateFrom,
for<'__> u32: CreateFrom,
impl CreateFrom for ParallaxMaterialUniformwhere
Self: ShaderType<ExtraMetadata = StructMetadata<9usize>>,
for<'__, '__> Vec4: CreateFrom,
for<'__, '__, '__, '__, '__, '__> f32: CreateFrom,
for<'__> u32: CreateFrom,
fn create_from<B: BufferRef>(reader: &mut Reader<B>) -> Self
Source§impl Default for ParallaxMaterialUniform
impl Default for ParallaxMaterialUniform
Source§fn default() -> ParallaxMaterialUniform
fn default() -> ParallaxMaterialUniform
Source§impl ReadFrom for ParallaxMaterialUniform
impl ReadFrom for ParallaxMaterialUniform
Source§impl ShaderSize for ParallaxMaterialUniform
impl ShaderSize for ParallaxMaterialUniform
Source§const SHADER_SIZE: NonZero<u64> = _
const SHADER_SIZE: NonZero<u64> = _
ShaderType::min_size)Source§impl ShaderType for ParallaxMaterialUniform
impl ShaderType for ParallaxMaterialUniform
Source§fn size(&self) -> NonZeroU64
fn size(&self) -> NonZeroU64
Self at runtime Read moreSource§fn assert_uniform_compat()
fn assert_uniform_compat()
Self meets the requirements of the
uniform address space restrictions on stored values and the
uniform address space layout constraints Read moreAuto Trait Implementations§
impl Freeze for ParallaxMaterialUniform
impl RefUnwindSafe for ParallaxMaterialUniform
impl Send for ParallaxMaterialUniform
impl Sync for ParallaxMaterialUniform
impl Unpin for ParallaxMaterialUniform
impl UnwindSafe for ParallaxMaterialUniform
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<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> 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> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self using data from the given World