/Mini-Ray-Tracer

๐ŸŒˆ Mini ray tracer โ€” Discovering 3d graphics using hyper-realistic lighting

Primary LanguageCMIT LicenseMIT

๐ŸŒž Mini Ray Tracer โ€” made with โค๏ธ and ๐Ÿง 

Discovering 3d graphics using hyper-realistic lighting generation
โ€ข Built by Job van der Zweep and Ruben Nijhuis

CI compile & run test


24 balls in a hallway with multicoloured lights and color transitions


๐Ÿƒโ€โ™€๏ธ โ€” Quick Start

It's very important to clone recursively as this project contains submodules!

$ git clone --recursive https://github.com/RubenNijhuis/Mini-Ray-Tracer.git
$ make run

If you're on Linux(Debian-like), you have to install the prerequisites for MLX42 โ†’ first:

sudo apt install build-essential libx11-dev libglfw3-dev libglfw3 xorg-dev

Features

  • Phong shading
  • Sphere, cylinder, plane and disc geometries
  • Camera & object rotations
  • Multi & colored spot light support
  • Multithreaded rendering with squares to see progress

๐Ÿ—ฃ โ€” Command list

$ ./bin/minirt [path-to-'.rt'-file]
Runs the program with an example rt file

$ make norm
Outputs the norminette across the src and include folder of every project

$ make test
Test the functions of MiniRT using Criterion

$ make run
Run the program with a default file test from the assets folder

$ make submodules
Pulls the most recent versions of the submodules 
!! BEWARE !! this could import breaking changes

๐Ÿ— โ€” Project structure

Mini-Ray-Tracer -/
  - ๐Ÿ–ผ assets -/    # All types of assets, output img
  - ๐Ÿ“ฆ bin -/       # Mini-Ray-Tracer output
  - ๐Ÿ‘€ include -/   # The .h files of the project
  - ๐Ÿ“š libs -/      # Our custom and vendor libraries
  - โ›ฒ๏ธ src -/       # Source files
  - ๐Ÿงช test -/      # Testing directory
  - .gitmodules     # Describes what submodules are installed
  - Makefile        # Compiling && linking magic happens here
  ...

๐ŸŽช โ€” Module folder structure

In this project we tried to adhere to a more modular structure of our project. Creating components that have one entry point and abstract the inner-workings.

Each module has a folder and file that match name-wise. Every other file can be seen as a part of that bigger module. In some cases some functions might be exposed to the larger project as it follows the DRY principle more.

๐Ÿ“ Folder name
  - File with that same folder name (this is the module entry point)
  - ...supporting files
  - Potential README explaining the setup and usage

๐Ÿงช โ€” Testing

$ make test
Test the functions of MiniRT using Criterion

Criterion Testing Library โ†’


๐Ÿ“ โ€” Notes

Our tips to write your own raytracer โ†’