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
|
|
@ -18,8 +18,8 @@ fn trace(ray: Ray, objects: &Vec<Object>) -> Option<(&Object, f32)> {
|
|||
pub fn cast_ray(ray: Ray, scene: &Scene) -> Color {
|
||||
if let Some((obj, dist)) = trace(ray, &scene.objects) {
|
||||
let point = ray.project(dist);
|
||||
let surface_color = obj.getcolor(point);
|
||||
surface_color
|
||||
let surface_texture = obj.gettexture(point);
|
||||
surface_texture.color
|
||||
}
|
||||
else { scene.background }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue