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.
And more...
👇 Try it yourself! 👇
git clone https://github.com/amethttp/miniRT.git miniRT \
&& cd miniRT \
&& make \
&& ./miniRT assets/scenes/pathtracer.rt;Run miniRT executable file and pass your favourite .rt scene file as an argument (examples given on assets/scenes).
./miniRT assets/scenes/demo.rt;| 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 |
| 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 |


