The RayTracer is a 3D rendering engine that simulates the physical behavior of light to create photorealistic images. This project implements the ray tracing algorithm to generate renders of 3D scenes with complex visual effects.
-
High-fidelity Rendering
- Physically accurate calculation of shadows, reflections, and refractions
- Anti-aliasing for sharper images
- Support for different output formats
-
Geometric Primitives
- Spheres, planes, cones, cylinders, and triangles
- Precise positioning and rotation of objects
- Extensible system for adding new shapes
-
Advanced Lighting System
- Ambient light for global illumination
- Directional lights simulating the sun
- Point lights for localized sources
- Soft and hard shadows
-
Customizable Materials
- Color and texture properties
- Ambient, diffuse, and specular coefficients
- Configurable reflection and transparency
-
Modular Architecture
- Plugin system to extend functionality
- Clear and documented programming interface
- Easy addition of new materials and primitives
macOS
brew install imagemagickLinux
sudo apt update
sudo apt install -y build-essential libsfml-dev libconfig++-dev imagemagickmake./raytracer scenes/demo.cfgpython3.10 create_animation.py [--shpere] [--cone] [--cylinder]The RayTracer uses .cfg files to define scenes to render. Here is a simplified example:
camera : {
resolution = { width = 0; height = 0; };
position = { x = 0; y = 0; z = 0; };
rotation = { x = 0; y = 0; z = 0; };
fieldOfView = 90.0;
};
primitives : {
spheres = ();
cylinders = ();
cones = ();
triangles = ();
planes = ();
};
lights : {
ambient = 0.0;
diffuse = 0.0;
point = ();
directional = ();
};
The project includes several predefined scenes that you can use to test the RayTracer:
scenes/easy.cfg: Simple scene for beginnersscenes/test.cfg: Test scene with multiple primitivesscenes/demo.cfg: Demonstration of the engine's capabilitiesscenes/artistic.cfg: Artistic compositionscenes/space.cfg: Space scene
The project also includes a web interface for testing the RayTracer online:
cd web
python app.pyOr visit directly https://raytracer.tektests.ovh
├── include/ # Headers and interfaces
├── src/ # Engine source code
├── plugins/ # Extensible primitives and materials
├── scenes/ # Scene configuration files
├── screenshots/ # Render screenshots
├── docs/ # Documentation generated by Doxygen
└── web/ # Web interface for testing the RayTracer
To add new primitives or materials, implement the IPrimitive or IMaterial interfaces and place your plugins in the plugins/ folder.
Project made by Epitech students. Here is a list of the contributors: