Add Texture struct to add extra texture information

This commit is contained in:
bijan2005 2021-01-24 00:06:23 -05:00
parent 07445dd4be
commit 20c32fc467
7 changed files with 51 additions and 35 deletions

View file

@ -97,3 +97,19 @@ impl Mul<f32> for Color {
}
}
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Texture {
pub color: Color,
pub albedo: f32
}
#[allow(dead_code)]
impl Texture {
pub fn new(red: f32, green: f32, blue: f32, albedo: f32) -> Self {
Texture {
color: Color::new(red, green, blue),
albedo: albedo
}
}
}