Skip to content

kayareyouokay/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Rust Ray Tracer

A simple ray tracer implemented in Rust, based on the "Ray Tracing in One Weekend" book by Peter Shirley.

Features

  • Ray-sphere intersection
  • Lambertian (diffuse) and metal materials
  • Antialiasing
  • Depth of field
  • Multithreaded rendering

Requirements

  • Rust (latest stable version recommended)
  • Cargo (Rust's package manager)

Building and Running

  1. Clone the repository:

    git clone [email protected]:kayareyouokay/raytracer.git
    cd raytracer
  2. Build the project:

    cargo build --release
  3. Run the ray tracer:

    cargo run --release

    The output will be saved as output.png in the project directory.

Controls

  • The scene is predefined in main.rs
  • You can modify the scene by editing the main function in src/main.rs
  • Adjust image quality by changing SAMPLES_PER_PIXEL and MAX_DEPTH constants

Output

The ray tracer will generate an image file named output.png in the project directory. The image will show a simple scene with several spheres on a large ground plane.

Learning Resources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages