Skip to main content

WeatheredMaterial

Type Alias WeatheredMaterial 

Source
pub type WeatheredMaterial = ExtendedMaterial<StandardMaterial, WeatheredExtension>;
Expand description

A StandardMaterial that is rained and snowed on: wet surfaces darken and gloss, rain runs down vertical faces, up-facing faces whiten under snow with the curve bevy_flora uses, and cloud shadows fall on it. See WeatheredExtension.

fn spawn(mut commands: Commands, mut meshes: ResMut<Assets<Mesh>>, mut materials: ResMut<Assets<WeatheredMaterial>>) {
    commands.spawn((
        Mesh3d(meshes.add(Cuboid::new(8.0, 6.0, 8.0))),
        MeshMaterial3d(materials.add(WeatheredMaterial {
            base: StandardMaterial { base_color: Color::srgb(0.6, 0.35, 0.3), perceptual_roughness: 0.9, ..default() },
            extension: WeatheredExtension::default(),
        })),
    ));
}

Aliased Type§

pub struct WeatheredMaterial {
    pub base: StandardMaterial,
    pub extension: WeatheredExtension,
}

Fields§

§base: StandardMaterial§extension: WeatheredExtension