Skip to content

apelykh/42-RT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

42-RT: Ray Tracing engine from scratch

RT screenshot

1. Overview

The project implements a Ray Tracing engine from scratch in C and OpenCL for rendering volumetric figures. The engine supports the following features:

  • 5 simple figures: plane, sphere, cylinder, [capped] cone, box + 1 complex figure: wineglass;
  • 4 operations that can be applied to simple objects to construct complex ones: union, intersection, difference, clipping;
  • 4 light source types: ambient, point, parallel, spot;
  • Reflective and transparent materials;
  • Camera movement in 3 dimensions with variable FOV;

 

2. Compilation

Requires SDL2, OpenCL

Linux: SDL2 headers should be located in /usr/include/SDL2

Mac OS: local version of SDL2 is included in ./frameworks

make to compile ./RT
make clean to delete .o files
make fclean to delete .o files and ./RT
make re to delete everything and recompile

 

3. Usage

./RT scene_file

Pre-defined scenes are located in ./scenes

Controls:

w, a, s, d - XY axes movement;

q, e - Z axis movement;

up, down - pitch angle change;

left, right - yaw angle change;

space - save screenshot to the project root folder

 

4. Screenshots

RT screenshot RT screenshot RT screenshot RT screenshot

Disclamer

Some code naming/grouping/architecture decisions are questionable and were influenced by the mandatory 42 codestyle.

About

Ray Tracing engine in C and OpenCL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages