martingarcialopez / miniRT

School project for 42 Paris

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

miniRT

School project for 42 Paris. The subject -> miniRT_subject

A basic ray tracer using the CPU, featuring antialiasing via adaptative supersampling and a multithreaded render. The supported primitives are spheres, planes, cylinders, squares, triangles, cubes and pyramids. There aren't any acceleration structures like BVH, and although it supports triangles, a proper KD-tree for polygon meshes acceleration were not included.

Installation

git clone https://github.com/martingarcialopez/miniRT.git && cd miniRT && make

The Makefile will compile the project properly on Linux and macOS machines. It will detect the number of cores of your computer and will define the number of threads used to render accordingly.

Usage

  • ./miniRT <scene.rt> To render the .rt scene passed as a parameter

  • ./miniRT <scene.rt> --save To save the .rt scene passed as a parameter to a .bmp file

Example

./miniRT scenes/cornellbox.rt

======================   Some samples (click on the images for larger size)   ======================

alt text

alt text

alt text

alt text

alt text

alt text

alt text

About

School project for 42 Paris


Languages

Language:C 81.0%Language:Objective-C 9.5%Language:Roff 6.9%Language:Makefile 1.5%Language:C++ 0.8%Language:Perl 0.2%