Skip to content

Jebbly/Basic-Raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Basic Raytracer using C++ and the Standard Library

This is a basic offline raytracer written in C++ with only the use of the standard library. It was primarily developed as a learning experience to practice C++ development and understand the fundamentals of raytracing.

Features

The raytracer can import simple .OBJ models with or without normal interpolation. Shapes can be grouped together in an axis-aligned bounding box as an acceleration structure, which is especially useful when importing 3d models with high tri-counts. The supported procedural shapes include:

  • Cones
  • Cubes
  • Cylinders
  • Planes
  • Spheres

These shapes can be assigned color or pattern materials. The Phong BRDF is used as the shading model and it also supports reflection and refraction using Schlick approximation for the Fresnel factor.

There is also support for multiple lights, so a rendered scene can include a combination of directional, point, and spot lights.

Examples

Glass Sphere (4000x4000): 1125-second render time Glass_Sphere

Patterned Spheres (3840x2160): 158-second render time Patterned_Spheres

Building

To setup the project for compilation after cloning, type:

cd basic-raytracer
mkdir build
cd build
cmake ..

Additional Resources

Fast, Minimum Storage Ray/Triangle Intersection

Ray-Primitive Intersections

Raytracer Challenge by Jamis Buck

Reflections and Refractions in Ray Tracing

About

A basic raytracer implemented with C++

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published