Skip to content
Bastian130Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RayTracer

EpiCorp Version License

A high-performance 3D rendering engine based on ray tracing technology that simulates the behavior of light to generate photorealistic images.

RayTracer Sample Render
Sample render featuring spheres with different materials (Phong, metal, mirror) and a pyramid on a flat surface

Overview

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

Installation

Prerequisites

  • C++ compiler
  • Make build system
  • libconfig++ (for parsing configuration files)
  • SFML library (for real-time visualization)

Building from Source

  1. Clone the repository:

    git clone https://github.com/EpiCorp/raytracer.git
    cd raytracer
  2. Build the project:

    make

This will compile the main executable and all plugins.

Usage

Basic Usage

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.ppm

Interactive Mode

To view the render in a window with real-time camera controls:

./raytracer <scene_file.cfg> -r

Camera Controls

In 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

Creating Scenes

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.

Sample Renders

RayTracer Sample Render

Scene with different material types including Phong shading, metallic reflection, and mirror effects

Documentation

License

This project is licensed under the MIT License - see the corporate_documentation.md file for details.

Authors

RayTracer is developed and maintained by EpiCorp.

Contributors

Thanks to the amazing contributors who made this project possible:

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages