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_asset;
|
2020-04-06 21:20:53 +00:00
|
|
|
use bevy_core;
|
2020-04-06 03:19:02 +00:00
|
|
|
|
2020-02-10 02:09:54 +00:00
|
|
|
#[derive(Uniforms)]
|
2020-04-06 21:20:53 +00:00
|
|
|
#[module(meta = false, bevy_render = "crate")]
|
2020-02-10 02:09:54 +00:00
|
|
|
pub struct StandardMaterial {
|
2020-03-22 01:12:30 +00:00
|
|
|
#[uniform(instance)]
|
2020-03-18 05:02:01 +00:00
|
|
|
pub albedo: Color,
|
2020-02-19 03:08:17 +00:00
|
|
|
#[uniform(shader_def)]
|
2020-03-18 05:02:01 +00:00
|
|
|
pub albedo_texture: Option<Handle<Texture>>,
|
2020-02-11 17:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for StandardMaterial {
|
|
|
|
fn default() -> Self {
|
|
|
|
StandardMaterial {
|
2020-03-18 05:02:01 +00:00
|
|
|
albedo: Color::rgb(1.0, 1.0, 1.0),
|
|
|
|
albedo_texture: None,
|
2020-02-11 17:31:49 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-12 03:09:05 +00:00
|
|
|
}
|