Add Texture struct to add extra texture information
This commit is contained in:
parent
07445dd4be
commit
20c32fc467
7 changed files with 51 additions and 35 deletions
16
src/types.rs
16
src/types.rs
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue