Simple GPU Path Tracing : Introduction

In this blog posts series, I'll show how to write a simple software renderer that uses path tracing for rendering beautiful photo realistic images.

It's not going to be a production renderer able to render huge scenes with billions of polygons. It will support the basic materials that are needed to render simple scenes. It will hopefully guide the reader on how to implement a path tracer, and will explain some of the theory behind it.

The path tracing code will run on the GPU. It will support either OpenGL or Cuda as backend graphics APIs (It will be designing it so that the same code will run on both platforms)

 

I'll go in as much details as possible for the important topics, but will probably gloss over some less interesting aspects of the development.

Here are a few disclaimers before you start reading : 

  • I'm not an expert in path tracers. Part of my work involves computer graphics so I know a few things about the field. I did this project to learn more about path tracing and gpu programming, and I thought that a good way of consolidating the knowledge I acquired in the process would be to share it online !
  • I'm not going to use any of the ray tracing hardware acceleration that's integrated in new GPU's. I wanted to built as many things as possible from scratch in order to understand the whole pipeline.
  • I've only tested the program on my machine (Windows x64), so not sure if it's going to work on other architectures.

 

I expect the reader to have a few prerequisites in computer graphics. I'm going to try to explain the more complicated concepts as best as I can, but I won't cover :

  • Maths for 3d graphics, there are tons of resources online and also great books for that.
  • OpenGL, Cuda, Shaders and gpu computing, We're not going to be using advanced features of openGL, so nothing too complex here, but I recommend reading the basics of learnopengl if you're not familiar with it, and especially the compute shader tutorial.


Summary : 

All the code will be freely available and each post will be contained in a separate branch of the github repository that I will link at the start of each post.


I'll use CMake for the building system, and the msvc compiler for compiling the code.

I'll be using some external libraries that will help the development. You can download a package of all the pre-built libraries here (will only work on msvc).

 

Here are a few shots taken with the final version of the renderer :

 Image showing a range of different materials supported by the renderer
Model : Loie Fuller from Minneapolis Institute of Art, by Joseph Kratina

Object with a glass like material
Model : Rhetorician Maker from engine9

 
 

 
Model : Cathedral by patrix

Model with a glass object that contains another object causing refraction effects
Model : Ship in a bottle by Loïc Norgeot
 

 
 Base Blender shapes, with different materials

Teapot with normal mapping, and liquid spilling out

Model : Renderman's Teapot by Dylan Sisson and Leif Pedersen   


with that said, let's get going to the first part (and most boring) part of the project : Setting our development environment up.


Next : Simple GPU Path Tracing, Part. 1 : Project Setup

Commentaires

Articles les plus consultés