Skip to content

AnuarTB/rusty-raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rusty Raytracer


Rust

This repo is just an experimental project that I have been doing, in order to learn Rust.

Screenshots

  • 5 samples per pixel
  • 6320 triangles

screenshot

How to use

In main.rs instantiate camera and a scene (in this order) and add to-be rendered objects to scene.objects array. Then run cargo run --release.

NOTE: As teapot model has thousands of triangles to render, the process might take a lot of time. You can simply remove this 3D model by commenting out the lines where it is added to scene.

//scene.objects.push(Box::new(obj));

TODO: The wasm integration will make usage easier.

Features

The following program has support of:

  • Diffuse and specular materials
  • Lights (3 types)
  • Reflections
  • Shadows
  • Camera and viewport control (FOV, orientation)
  • Antialising (by multisampling)
  • Simple .obj file reading
  • AABB optimization
  • Multithreading
  • Builder pattern for constructing objects

To do

  • Integration with WebAssembly
    • Interaction with objects
  • Gamma correction
  • Refraction
  • Textures

Related

It was in turn inspired by several projects listed below: