Skip to content

universome/rtrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RtRs

Simple ray tracing & rasterization engine written in rust.

Newell Teaset (ray tracing example)

Features

Ray Tracing:

  • Rendering quadrics: sphers, cones, cones (with slabs),
  • Rendering meshes (passed as .obj files). Also precomputing vertex normals
  • Bounding Volumes Hierarchy
  • Full camera movement + zoom
  • Precomputed mesh normals
  • Object rotations
  • Parallel execution
  • Lambertian/Phong shading
  • Gouraud/Phong shading
  • Antialiasing via supersampling (via distributed ray tracing)
  • Soft shadows (via distributed ray tracing)
  • Reflections + glossy reflections (via distributed ray tracing)
  • Refraction & attenutation

Rasterization:

  • Mesh rasterization
  • Object rotation
  • Lambertian/Phong shading
  • Gouraud/Phong shading
  • Texture mapping with stripe effect
  • Backface culling
  • Full camera movement + zoom
  • Simple antialising (via supersampling)
  • Clipping
  • Camera movement

How to run the code

You need to install Rust on your system and then just type the command:

cargo run --release

The binary file will be located at target/release/rtrs. There is also a binary attached which is located at rtrs (Note: compiled on OS X Catalina 10.15.6).

Core dependencies

  • tobj to load .obj files
  • nannou to open a window and detect key press events, which is an analog of OpenFrameworks for Rust language
  • image to save an image
  • rayon which provides easy-to-use parallelism for Rust

Disclaimer

All experiments are done on MacBook Pro 16' with 2,3 GHz 8-Core Intel Core i9.

About

Simple ray tracing and rasterization engine

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages