Skip to content
3D raytracing engine in C
C CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.gitmodules
CMakeLists.txt
README.md
checkerboard.png
grad0.png
out1.png
suzanne.obj
worldmap.png

README.md

cdrt

Raytracing engine in 3D.

Planned features:

  • Physics simulation
  • Audio simulation (for reverb)
  • Animation
  • OpenCL port for GPU accel
  • Rasterizer preview/quick render

This is still very much WIP

Output

This image (512x512) was rendered at x4 multisampling with 8 bounces. It uses the suzanne model from blender, and sphere and plane primitives.

This took 90 seconds to render, and this was without using any optimizations on computing mesh intersections (without the mesh it rendered in around 1 second)

out1.png

Building

This uses CMake and requires ZERO outside libraries, so:

mkdir build

cd build

cmake ..

and then

make

To test it, run ./src/ex and then view test.bmp

Papers/Sources

Good general explanation: https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/how-does-it-work

Explanation on lighting/shading: https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-shading/reflection-refraction-fresnel

You can’t perform that action at this time.