Simple Raytracing Engine is a minimalist 3D renderer written in C. It utilizes the ray-tracing algorithm to simulate the physical behavior of light, rendering realistic images with shadows, reflections, and lighting effects. This project is built using the MiniLibX graphical library.
- Primitive Objects:
- Spheres: Perfect geometric spheres with adjustable radius.
- Planes: Infinite surfaces for floors, walls, or ceilings.
- Cylinders: Finite cylinders with configurable diameter and height.
- Lighting Model:
- Ambient Lighting: Global illumination to ensure objects are visible even in shadow.
- Diffuse & Specular: Implementation of the Phong reflection model for realistic surface highlights.
- Hard Shadows: Accurate shadow casting based on light source visibility.
- Camera System: Fully adjustable camera with position, orientation, and Field of View (FOV) control.
- Scene Description: Flexible scene configuration using
.rtfiles.
To compile and run this engine, you will need:
- Operating System: macOS or Linux.
- Compiler:
gccorclang. - Libraries: MiniLibX (included) and its dependencies (X11 and associated headers).
- Clone the repository:
git clone <your-repo-url>
cd miniRT- Compile the project:
makeThis will produce an executable named simple_rt (or your configured output name).
Running the Engine Pass a scene configuration file as an argument:
Pass a scene configuration file as an argument:
./simple_rt world/example.rtExample .rt File
A 0.2 255,255,255
C -50,0,20 0,0,1 70
L -40,0,30 0.7 255,255,255
sp 0,0,20 20 255,0,0
pl 0,0,0 0,1.0,0 200,200,
- ESC: Close the window and exit the application.
- window Close (X): Exit the application gracefully.
- src/: Core logic including ray-object intersection and color calculation.
- include/: Header files for all modules.
- libft/: Custom utility library for string and memory management.
- world/: Sample scene files to showcase the engine's capabilities.
This project is developed for educational purposes. The MiniLibX library is subject to its own licensing terms.