Skip to content

A basic ray tracer in rust by following the Ray Tracer Challenge book by Jamis Buck

Notifications You must be signed in to change notification settings

shauryagoel/The_Ray_Tracer_Challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Ray Tracer

This repository contains rust code for the book "Ray Tracer Challenge by Jamis Buck".

It is not meant to be an optimised version of the ray tracer. I followed this book to learn the Rust programming language. I have made sure to replicate the various logic and tests presented throughout the book. I may be wrong in some cases and not follow idiomatic code, but, I will try to keep the code well documented and easy to read.

Project structure

  • src/ : contains the code for various data types like tuple, vector, projectile etc and unit tests.
    • bin/ : contains end of the chapter exercises

Testing

All the unit tests are present in the each of the source code files. You can run all the tests using the command-

cargo test

Building the binaries

You have to build each binary in the src/bin directory separately.

cargo run --bin <binary file name without extension>

TODO

  • Use modules to organise the code
  • Use borrowing instead of creating copies to make code efficient
  • Optimise the matrix class
  • Reduce unnecessary dependencies between structs and move out ray tracing related functions

Renderings

Spheres with shadows

Chapter 8 Rendering

About

A basic ray tracer in rust by following the Ray Tracer Challenge book by Jamis Buck

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages