A high-performance 3D rendering engine based on ray tracing technology that simulates the behavior of light to generate photorealistic images.
Sample render featuring spheres with different materials (Phong, metal, mirror) and a pyramid on a flat surface
RayTracer is a physically-based rendering engine that creates stunning images by tracing the path of light through a virtual scene. Unlike traditional 3D modeling software, RayTracer allows you to create complex scenes simply by describing them in a text-based configuration file.
Key Features:
- Physically accurate light simulation
- Multiple primitive types (spheres, planes, cones, cylinders, pyramids)
- Advanced material system (flat color, phong, mirror, metal, glass)
- Realistic reflections and lighting effects
- Multi-threaded rendering for optimal performance
- Extensible plugin architecture
- Real-time preview with SFML
- C++ compiler
- Make build system
- libconfig++ (for parsing configuration files)
- SFML library (for real-time visualization)
-
Clone the repository:
git clone https://github.com/EpiCorp/raytracer.git cd raytracer -
Build the project:
make
This will compile the main executable and all plugins.
To render a scene:
./raytracer <scene_file.cfg>This will output a PPM image to stdout, which you can redirect to a file:
./raytracer scenes/example.cfg > output.ppmTo view the render in a window with real-time camera controls:
./raytracer <scene_file.cfg> -rIn interactive mode, you can navigate the scene using the following keyboard controls:
- Arrow keys: Move camera horizontally
- Space/Shift: Move camera up/down
- Q/D: Rotate camera horizontally
- Z/S: Rotate camera vertically
- Escape: Exit the application
RayTracer uses configuration files (.cfg) to define scenes. These files specify the camera parameters, primitives, materials, and lighting setup.
Example scene configuration:
camera =
{
resolution = { width = 1920; height = 1080; };
position = { x = 0; y = -100; z = 20; };
rotation = { x = 0; y = 0; z = 0; };
fieldOfView = 72.0;
};
primitives =
{
spheres = (
{
x = 0; y = 0; z = 20; r = 25;
color = { r = 255; g = 0; b = 0; };
material = { type = "phong"; ambient = 0.2; diffuse = 0.7; specular = 0.8; shininess = 64.0; };
}
);
planes = (
{
axis = "Z"; position = -20;
color = { r = 200; g = 200; b = 200; };
material = { type = "flat_color"; };
}
);
};
lights =
{
ambient = 0.2;
diffuse = 0.8;
point = (
{ x = 0; y = 0; z = 50; color = { r = 255; g = 255; b = 255; }; }
);
};
For more detailed information on creating scene configurations, please refer to the Configuration Reference.
Scene with different material types including Phong shading, metallic reflection, and mirror effects
- Technical Documentation - Detailed explanation of the architecture and algorithms
- User Guide - Guide for end users explaining how to use the software
- Configuration Reference - Complete reference for creating .cfg files
- Corporate Documentation - Business and legal information
This project is licensed under the MIT License - see the corporate_documentation.md file for details.
RayTracer is developed and maintained by EpiCorp.
Thanks to the amazing contributors who made this project possible: