Skip to content

Simple ray tracer made in Rust based on Peter Shirley's book "Ray Tracing in One Weekend".

License

Notifications You must be signed in to change notification settings

corrieriluca/raytracing-in-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracing in Rust

Simple path tracer made in Rust based on Peter Shirley's book Ray Tracing in One Weekend.

To-do:

  • Ray Tracing in One Weekend (actually in more than one weekend...)
  • Refactor the code
  • Command line arguments
  • Progress bar
  • Parallelism (multithreading)
  • Save to a better image format (BMP)
  • Load .obj files

Usage

As stated in the ./.cargo/config.toml file, this package use the rustc flag -Ctarget-cpu=native (which can be seen as equivalent to gcc/clang's -march=native flag). Thus for better performance, the produced binary should be run on the same machine on which it has been compiled.

$ cargo build --release
$ ./target/release/raytracing_in_rust --help
Raytracing in Rust 0.1.0

USAGE:
    raytracing_in_rust [FLAGS] [OPTIONS] <output>

FLAGS:
    -d, --debug       Print debug information
    -h, --help        Prints help information
    -p, --parallel    Use multithreading for rendering
    -V, --version     Prints version information

OPTIONS:
    -j <thread-number>        Number of threads to spawn. Default is number of logical cores

ARGS:
    <output>    Where to save the result (BMP file)

About

Simple ray tracer made in Rust based on Peter Shirley's book "Ray Tracing in One Weekend".

Topics

Resources

License

Stars

Watchers

Forks

Languages