This is the Raytracer project, an Epitech project from the OOP module (Object Oriented Programming).
The objective is to build a 3D scene with light rays generate beautiful images.
We pushed the idea a little further with an interactive scene that creates, edit and delete primitives, loads objfile, saves image at runtime. See Features.
This project is compatible with : Linux, Windows and MacOS.
Be sure to have libconfig++ installed.
Debian/ubuntu install :
sudo apt install libconfig++-devArch install:
sudo pacman -S libconfigSince ImGui isn't natively supporting SFML, you need to install the following dependencies :
- glew
- glfw
For Fedora :
sudo dnf install glew glfwFor Arch :
sudo pacman -S glew glfwFirst of all you will need to compile the project, for that you can write in your terminal
makeor if you want a way more impressive demo, you can write in your terminal
make bonusor if you love yourself and want to watch you in our incredible raytracer, you can write in your terminal
make bonusbonusNote: To change from normal interface to bonus interface or from bonus to normal, you need to apply clean your repository with
make fclean
and now you can lauch it with :
./raytracer scenes/config_example.cfgto have a picture in .ppm. If you want to have it in .png you can do the command
./raytracer && ffmpeg -y -i out.ppm out.png && xdg-open out.pngAnd if you want to have the interractive mode, you can add the -i option like :
./raytracer -i scenes/config_example.cfgand if you want to recovered an old scene, you can do the command
./raytracer -i scenes/quicksave.cfgTo have all the information about the config file, you can check the CONFIG.md file.
To build the documentation, you can do the command
make docand to run it, you can do the command
make rundocImGui used with ImGuiSfml to create a GUI in SFML that allows to edit the scene in real time and save it, and more, check the shortcuts!
Keybinds (by default)
| Key | Action |
|---|---|
| Z | Move forward |
| Q | Move left |
| S | Move backward |
| D | Move right |
| Space bar | Move up |
| Left Shift | Move down |
| U | Rotate up |
| J | Rotate down |
| H | Rotate left |
| K | Rotate right |
| Left Control | Sprint |
| Key | Action | In Minecraft mode |
|---|---|---|
| M | Switch to Minecraft mode | Goes back to normal mode |
| Left click | Destroy minecraft block | |
| Right click | Use simple mouse to rotate the camera | Place minecraft block |
| G / Middle click | Select primitive at the center of the screen (in bonus mode) | Same behavior |
| R | Draw spheres at the reach distance | Same behavior |
| 0-9 | Change the selected Material of your inventory |
| Key | Action |
|---|---|
| Escape | Exit (and saves your scene in scenes/temp.cfg) |
| C | Save scene to the opened one and exit |
| X | Quick save and exit (in scenes/quick_save.cfg) |
| Key | Action |
|---|---|
| F2 | Take a screenshot (saved in screenshots/171503-.png |
| F3 | Toggle debug tab |
| Delete | Remove selected object (it has to be selected in the GUI) |
| F | Toggle fullscreen |
| O | Reset camera to the loaded position |
Note: You can change the keybinds in
config/keys.cfgfile.
Attention: If you messed up your config, delete it and it will be recreated with default values.
- Sphere
- Plane
- Cylinder
- Cone
- Limited Cylinder
- Limited Cone
- Triangle
- Cube
- Torus
- Tanglecube
- Objfile (with textures)
- Mobius strip
- Fractals
- Point light
- Directional light
- Ambient light
- Drop shadows
- Multiple ambient lights
- Multiple directional lights
- Multiple point lights
- Colored light
- Phong reflection model
- Ambient occlusion
- Flat color
- Transparency
- Refraction
- Reflection
- Refraction
- Texturing from file (on Spheres, Cubes, Triangles and Plane)
- Texturing from procedural generation of chessboard (with any size and color)
- Texturing from procedural generation of Perlin noise
- Translation
- Rotation
- Scale
- Scene graph
- Add primitives to the scene (including objfile)
- Set up lightning
- Set up camera
Can configure in real time with ImGui See CONFIG.md
- Skybox
- Inventory
- Cube Primitive
- Minecraft mode
- Save scene
- Cinematic mode
- Texture camera in bonusbonus
- Space partitioning (bounding boxes)
- Multithreading
- Clustering













