dhawals1939 / raytracer

A minimal GPU accelerated ray tracer written in OpenGL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ray Tracer

A minimal GPU accelerated ray tracer written in OpenGL.

10k Samples / 813 Seconds
10k Samples / 813 Seconds

Features:

  • Next event estimation
  • GGX microfacet model for variable roughness
  • Sampling of visible normal distribution function
  • Progressive rendering
  • BVH acceleration

Screenshots

Normals Normals Compare Samples
Left: Normals, Middle: Diffuse, Right: Quality vs Samples

Requirements

  • CMake
  • GPU with OpenGL (>= 4.6) support
  • GLFW (already included)
  • GLAD (aldreay included)
  • STB (already included)

Build

mkdir build
cd build
cmake ..
make

Usage

raytracer <NUM_SAMPLES> <IMAGE_SIZE> <IMAGE_PATH>

TODO:

  • SVGF denoising
  • Transmissive materials (glass, water etc.)
  • Allow importing OBJ files
  • Bidirectional path tracing
  • Move to Vulkan and use hardware ray tracing acceleration

Known Issues

  • There are some ringing artifacts on the left Cuboid and the Sphere (see diffuse.png).
  • Using BVH is actually slower than not using it (11s vs 8s for 100 samples).

About

A minimal GPU accelerated ray tracer written in OpenGL.


Languages

Language:C 90.9%Language:GLSL 5.2%Language:C++ 3.4%Language:CMake 0.5%