bevy/bevy_render/src/shader/uniforms/standard_material.rs

25 lines
589 B
Rust
Raw Normal View History

2020-04-06 03:19:02 +00:00
use crate::{texture::Texture, Color};
use bevy_asset::Handle;
2020-02-10 02:09:54 +00:00
use bevy_derive::Uniforms;
2020-04-06 03:19:02 +00:00
use bevy_core;
use bevy_asset;
2020-02-10 02:09:54 +00:00
#[derive(Uniforms)]
2020-04-06 03:19:02 +00:00
#[uniform(bevy_render_path = "crate", bevy_core_path = "bevy_core", bevy_asset_path = "bevy_asset")]
2020-02-10 02:09:54 +00:00
pub struct StandardMaterial {
#[uniform(instance)]
pub albedo: Color,
#[uniform(shader_def)]
pub albedo_texture: Option<Handle<Texture>>,
2020-02-11 17:31:49 +00:00
}
impl Default for StandardMaterial {
fn default() -> Self {
StandardMaterial {
albedo: Color::rgb(1.0, 1.0, 1.0),
albedo_texture: None,
2020-02-11 17:31:49 +00:00
}
}
}