Skip to content

amethttp/miniRT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Mini)RT

A (small) raytracer and pathtracer using MLX, the graphic library of 42.

GPU utilization is forbidden in this project. To enhance our goal of achieving smooth movement and fast rendering, we implemented multi-threading, pixel shuffling, and an optimized rendering mode during motion. This approach not only improves performance but also ensures a seamless visual experience.

Index

  1. Exports
  2. Setup and run
  3. Controls

Exports

assets/scenes/demo.rt_12000s 12000 samples

beautiful_aa_7d_768s 768 samples

Pathtracer_10000s 10000 samples

And more...

👇 Try it yourself! 👇

Setup and run

Requirements

Download and execute

git clone https://github.com/amethttp/miniRT.git miniRT \
&& cd miniRT \
&& make \
&& ./miniRT assets/scenes/pathtracer.rt;

Execute

Run miniRT executable file and pass your favourite .rt scene file as an argument (examples given on assets/scenes).

./miniRT assets/scenes/demo.rt;

Controls

Key(s) Action(s)
1 Switch render strategy to PathTracer
2 Switch render strategy to RayTracer
3 Switch render strategy to NormalMap
4 Switch motion cheap render off
5 Switch progressive render off
X Export .ppm image
B Block controls
R / F5 Restart render
P Pause / play progressive render
L Toggle loader visibility
C Reset camera
Left click Select object & switch to edit mode
I, O Regulate FOV
G, H Regulate focus radius
J, K Regulate focus distance
Ctrl / Cmd + S Save changes to .rt file
Ctrl / Cmd + Shift + S Duplicate .rt file
W, A, S, D, shift, space Move camera position
Arrows Move camera orientation
Esc Quit program

Edit mode

Key(s) Action(s)
Left click Select object
Enter / Right click De-select object
N New figure
Backspace Delete figure
T Next figure type
M Next figure material
F Focus camera to figure
W, A, S, D, shift, space Move figure position
Arrows, Q, E Rotate figure

About

A small raytracer using MLX, the graphic library of 42.

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •