June, 2022

Global illumination

Abstract

Producing an image that simulates the effect of global illumination with a relative small amount of noise is a difficult task when it comes to having relatively short render times. It states the need for knowing the effectiveness of variance reduction techniques. Variance reduction techniques try to reduce the noise in the image without having to increase the amount of samples the rendering algorithm needs to produce an image. The technique that will be used for the rendering algorithm is a combination of the Monte Carlo integration and path tracing. Then the variance reduction techniques, stratified and importance sampling, will be introduced. At the end it will be proven that these variance reduction techniques are effective in rendering images with less noise without needing extra samples and with a similar render time.

The project

The research process

For half a year, I had the opportunity to do my own research project. As my first love in the game industry is graphics programming, I knew I wanted to do something on this topic. What intrigued me most out of all the topics, was global illumination. Very early on in my research I already had the idea of going in the direction of offline rendering, rather than real time rendering, because it was something I had never done before. With this decision, my research became more oriented towards path tracing, as this is a commen way to simulate global illumination in an image in a relatively easy way.

research process image The path tracer is a rendering algorithm that tries to solve the rendering equation by tracing paths through the scene. With this concept it is fairly easy to see that indirect lighting will be accounted for as we bounce around an finite number of times in the scene.
The way this rendering algorithm solves the rendering equation is by an estimation, as the solution is an endless recursive function. Because we need this estimation, we need an understanding of basic statistics and probability theory. My understanding of these topics were very limited when starting my research, which defined another layer of the project. As it is preferred to have a result that is correct on average, I implemented the Monte Carlo integration technique.
Also, a good research question isn't based on a yes or no question, so I needed to find something that I wanted to compare and contrast. During my research of the Monte Carlo integration, there was a certain topic that was always discussed: the noise in an image. After further research, I was able to make the connection between variance reduction techniques and the noise in an image, as the first tries to solve the second in the best way possible. This then results in an image with minimal noise production.
The goal of this research was to compare these variance reduction techniques to how effective these techniques were. This has been tested by benchmarking the variance reduction techniques and by calculating image quality metrics. I was able to conclude that we can indeed see that these variance reduction techniques were effective in both generated noise and in time.

Approach

Yielding images that are physically plausible and visually pleasing wiht respect to global illumination is the ultimate goal of this research. To understand everything that is needed to generate an image like this, we need to take a deeper dive into the concepts of light and the techniques behind the rendering algorihm. For this I would like to refer to my detailed paper about this topic, where the following topics are discussed:

  • A model for capturing light to be able to display it on an image.
  • a model for materials with which light interacts.
  • A model to capture the objects in the scene.

To be able to understand the Monte Carlo Integration we need a profound knowledge of statistics. Following topics are very important:

  • What are random variables.
  • What is the probability density function (PDF)
  • What is the variance of the PDF.
  • What is the Monte Carlo Method and estimator.

All these topics are in depth discussed in the paper, that can be found at the bottom of this page. For the variance reduction techniques there was knowledge needed about sampling, and thus sampling theory.

  • Which sampling function do we use.
  • Different techniques of sampling.
These different sampling techniques directly translate in the variance reduction techniques because these try to make the variance as small as possible.

Technical approach

Software used for this project:

  • Overleaf as latex editor
  • Visual studio as IDE
  • Powerpoint to make visuals and graphs
The path tracer is written in C++ code in the Elite engine render framework provided by the school (Howest University of Applied Sciences) and is based on the ray tracing books of Peter Shirley.

Results

The experiments together with the results that were reproduced shows that the variance reduction techniques are indeed efficient ways to reduce noise in a rendered image. It can even be said that these techniques are not only more efficient in reducing the noise, but also more efficient in time. The results are shortly discussed in the next paragraphs.

Beauty Render

The image on the left is rendered with 1000 samples per pixel and a 100 depth, it also combines all different variance reduction techniques implemented in the path tracer. This is also the best result I could get out of my path tracer in a reasonable amount of time. In the image on the bottom image it can be seen that global illumination is simulated because:

  • Light reflected on the walls (left render).
  • Light on the objects in the scene (middle render).
  • Soft shadows that are visible underneath the objects (right render).
More experiments with their images and can be found in my paper under section 6 Discussion, such as:
  • High number of samples per pixel vs. a low number of samples per pixel.
  • High depth number vs. a low depth number.
  • Comparisons between different sampling strategies.

Render times

When looking at the average timing results from the benchmark it can be concluded that these variance reduction techniques are even better in time. It takes on average less time than the normal sampling. It can also be seen that stratified sampling on average takes a little bit less time than its counterpart.

Image Quality Metrics

These image quality metrics indicate how good the quality of an image is compared to a reference image. For the mean squared error (MSE) can be said:

  • Importance sampling has the biggest values due to the hard shadows.
  • Combination of importance sampling and normal smapling gives significantly smaller values.
Then the peak signal-to-noise ratio (PSNR) and signal-to-noise ratio (SNR) give:
  • Importance sampling on it's own has low values this due to the hard shadows that are in the image.
  • Combination of normal sampling and importance sampling give the highest results, which is better.
The last one is the structural similarity index (SSI), which gives results in the same trend as the PSNR and SNR which gives us the same conclusion as with the PSNR and SNR.

In general can be said that these variance reduction techniques give a closer simulation to the real world than the pure Monte Carlo integration.

Links

To read and see more details about this research project I kindly refer to my written paper and the accompanied code base about this topic .