Skip to content

Hperigo/rust-raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracing in One Weekend, but in rust.

result

A ray tracer written in rust, using Peter Shirley book as guide: https://raytracing.github.io/books/RayTracingInOneWeekend.html

Notes and TODO's:

  1. Why do we need this type of MaterialClone trait? And also why cant we call clone on geometry.rs and can only call clone_box?
pub trait  MaterialClone {
    fn clone_box(&self) -> Box<dyn Material>;
}

impl<T> MaterialClone for T
where
    T: 'static + Material + Clone,
{
    fn clone_box(&self) -> Box<dyn Material> {
        Box::new(self.clone())
    }
}

impl Clone for Box<dyn Material> {
    fn clone(&self) -> Box<dyn Material> {
        self.clone_box()
    }
}
  1. Fix bug on thread tilling logic.

About

Raytracing in one weekend but in Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages