<p>One of the big ones is the use of <a href="https://en.wikipedia.org/wiki/Constructive_solid_geometry">constructive solid geometry</a> rather than triangle meshes.  Ray-triangle intersections are faster than almost any other ray-shape intersection, but it takes huge numbers of triangles to approximate the surface of a cylinder or torus, not to mention some of the really exotic shapes such as julia fractals or generalized parametric functions that some renderers support.</p>

<p>Another is the use of render-time <a href="https://en.wikipedia.org/wiki/Photon_mapping">photon mapping</a> and <a href="https://en.wikipedia.org/wiki/Diffuse_reflection">diffuse interreflection</a> calculations: this lets you get accurate lighting effects in a changing scene.  In realtime raytracing, these are too expensive to compute, so either light sources and major geometry elements are forced to be stationary (to permit pre-calculation), or the effects are omitted entirely.</p>

CC BY-SA 3.0
2015-08-14T17:58:47.153Z
2015-08-14T17:58:47.153Z
Mark
<p>Even though I didn't know about monte carlo path tracing when I wrote this, I accidentally described it.  Ironically, monte carlo path tracing is the answer I was looking for at the time.</p>

<p>Naive monte carlo path tracing works by evaluating something called the rendering equation to numerically solve the color value of a pixel.  It takes random samples by randomly jittering within a pixel (there are better sampling strategies, and filtering: <a href="https://computergraphics.stackexchange.com/questions/4013/what-is-the-fundamental-reasoning-for-anti-aliasing-using-multiple-random-sample">What is the fundamental reasoning for anti aliasing using multiple random samples within a pixel?</a>) and also by bouncing in random directions when a ray hits a surface.</p>

<p>It can take a lot of samples to give you good results, and with not enough samples, your image will look noisy.  It takes 4 times as many samples to cut the noise in half.  Render times can be on the order of an hour using 8 modern CPU cores for a simple scene.</p>

<p>There are more advanced monte carlo path tracing techniques that let you get better images more quickly, such as importance sampling, or denoising the image after it's rendered.</p>

<p>Monte carlo path tracing can make photorealistic images and gives you many advanced rendering features just because it follows physical laws so gives realistic results.</p>

<p>You can read more about it here:
<a href="http://blog.demofox.org/2016/09/21/path-tracing-getting-started-with-diffuse-and-emissive/" rel="nofollow noreferrer">http://blog.demofox.org/2016/09/21/path-tracing-getting-started-with-diffuse-and-emissive/</a></p>

<p>Here is an example image, which took about an hour to render using all 8 of my cpu cores:</p>

<p><a href="https://i.sstatic.net/EacNQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EacNQ.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-10-06T17:04:22.083Z
2016-10-06T17:04:22.083Z
2017-04-13T13:00:43.660Z
Alan Wolfe
<p>Path tracing is the standard technique in non-realtime photorealistic rendering, and you should look specifically into <a href="https://en.wikipedia.org/wiki/Path_tracing#Bidirectional_path_tracing" rel="noreferrer">bidirectional path tracing</a> to get effects like caustics, which you can't really get with basic path tracing. Bidirectional path tracing also converges faster to the ground truth as shown in the below image:
<a href="https://i.sstatic.net/3fg6U.jpg" rel="noreferrer"><img src="https://i.sstatic.net/3fg6U.jpg" alt="enter image description here"></a>
Also <a href="https://en.wikipedia.org/wiki/Metropolis_light_transport" rel="noreferrer">Metropolis light transport</a> (MLT) is a more advanced path tracing technique that converges even faster to the ground truth by mutating existing "good" paths:
<a href="https://i.sstatic.net/KoMaU.jpg" rel="noreferrer"><img src="https://i.sstatic.net/KoMaU.jpg" alt="enter image description here"></a></p>

<p>You can also use importance sampling for faster convergence by focusing more rays to the directions that matter more. I.e. by focusing rays based on BRDF (more towards the BRDF spike using probability density function) or to the light source, or get best of the two worlds and using multiple importance sampling. 
<a href="https://i.sstatic.net/TiwGE.png" rel="noreferrer"><img src="https://i.sstatic.net/TiwGE.png" alt="enter image description here"></a>
This is all about reducing noise in unbiased manner. There are also <a href="https://benedikt-bitterli.me/nfor/" rel="noreferrer">denoising techniques</a> to further reduce noise in the rendered images.
<a href="https://i.sstatic.net/YFQ8H.jpg" rel="noreferrer"><img src="https://i.sstatic.net/YFQ8H.jpg" alt="enter image description here"></a></p>

<p>I think it's best to first implement basic brute force Monte Carlo path tracer to serve as unbiased reference before looking into the more advanced techniques. It's quite easy to do mistakes and introduce biasing that goes unnoticed, so having simple implementation is good to have around for reference.</p>

<p>You can also get some really nice results by applying path tracing to participating media but that gets slow really fast :D
<a href="https://i.sstatic.net/3Cmp6.png" rel="noreferrer"><img src="https://i.sstatic.net/3Cmp6.png" alt="enter image description here"></a></p>

CC BY-SA 3.0
2016-10-06T19:02:30.053Z
2016-10-06T19:37:04.423Z
2016-10-06T19:37:04.423Z
JarkkoL
<p>I've played with real time raytracing (and raymarching etc) quite a bit, but haven't spent that much time on non real time raytracing - for higher quality images or for pre-rendering videos and the like.</p>

<p>I know one common technique to improve image quality in the non real time case is to just cast A LOT more rays per pixel and average the results.</p>

<p>Are there any other techniques which stand out as good ways to improve image quality in the non real time case, over what you would normally do in the real time case?</p>

<raytracing><photo-realistic>
Non Real Time Raytracing
Alan Wolfe
# Non Real Time Raytracing

(Asked by: username_0 on 2015-08-14)

I've played with real time raytracing (and raymarching etc) quite a bit, but haven't spent that much time on non real time raytracing - for higher quality images or for pre-rendering videos and the like.

I know one common technique to improve image quality in the non real time case is to just cast A LOT more rays per pixel and average the results.

Are there any other techniques which stand out as good ways to improve image quality in the non real time case, over what you would normally do in the real time case?

**Tags:** raytracing, photo-realistic


---

## 3 answers

### Answer by username_2 on 2016-10-06. Score: 11 | Accepted answer

Path tracing is the standard technique in non-realtime photorealistic rendering, and you should look specifically into [bidirectional path tracing](https://en.wikipedia.org/wiki/Path_tracing#Bidirectional_path_tracing) to get effects like caustics, which you can't really get with basic path tracing. Bidirectional path tracing also converges faster to the ground truth as shown in the below image:
[![enter image description here](https://i.sstatic.net/3fg6U.jpg)](https://i.sstatic.net/3fg6U.jpg)
Also [Metropolis light transport](https://en.wikipedia.org/wiki/Metropolis_light_transport) (MLT) is a more advanced path tracing technique that converges even faster to the ground truth by mutating existing "good" paths:
[![enter image description here](https://i.sstatic.net/KoMaU.jpg)](https://i.sstatic.net/KoMaU.jpg)

You can also use importance sampling for faster convergence by focusing more rays to the directions that matter more. I.e. by focusing rays based on BRDF (more towards the BRDF spike using probability density function) or to the light source, or get best of the two worlds and using multiple importance sampling.
[![enter image description here](https://i.sstatic.net/TiwGE.png)](https://i.sstatic.net/TiwGE.png)
This is all about reducing noise in unbiased manner. There are also [denoising techniques](https://benedikt-bitterli.me/nfor/) to further reduce noise in the rendered images.
[![enter image description here](https://i.sstatic.net/YFQ8H.jpg)](https://i.sstatic.net/YFQ8H.jpg)

I think it's best to first implement basic brute force Monte Carlo path tracer to serve as unbiased reference before looking into the more advanced techniques. It's quite easy to do mistakes and introduce biasing that goes unnoticed, so having simple implementation is good to have around for reference.

You can also get some really nice results by applying path tracing to participating media but that gets slow really fast :D
[![enter image description here](https://i.sstatic.net/3Cmp6.png)](https://i.sstatic.net/3Cmp6.png)


---

### Answer by username_1 on 2015-08-14. Score: 6

One of the big ones is the use of [constructive solid geometry](https://en.wikipedia.org/wiki/Constructive_solid_geometry) rather than triangle meshes. Ray-triangle intersections are faster than almost any other ray-shape intersection, but it takes huge numbers of triangles to approximate the surface of a cylinder or torus, not to mention some of the really exotic shapes such as julia fractals or generalized parametric functions that some renderers support.

Another is the use of render-time [photon mapping](https://en.wikipedia.org/wiki/Photon_mapping) and [diffuse interreflection](https://en.wikipedia.org/wiki/Diffuse_reflection) calculations: this lets you get accurate lighting effects in a changing scene. In realtime raytracing, these are too expensive to compute, so either light sources and major geometry elements are forced to be stationary (to permit pre-calculation), or the effects are omitted entirely.


---

### Answer by username_0 on 2016-10-06. Score: 5

Even though I didn't know about monte carlo path tracing when I wrote this, I accidentally described it. Ironically, monte carlo path tracing is the answer I was looking for at the time.

Naive monte carlo path tracing works by evaluating something called the rendering equation to numerically solve the color value of a pixel. It takes random samples by randomly jittering within a pixel (there are better sampling strategies, and filtering: [What is the fundamental reasoning for anti aliasing using multiple random samples within a pixel?](https://computergraphics.stackexchange.com/questions/4013/what-is-the-fundamental-reasoning-for-anti-aliasing-using-multiple-random-sample)) and also by bouncing in random directions when a ray hits a surface.

It can take a lot of samples to give you good results, and with not enough samples, your image will look noisy. It takes 4 times as many samples to cut the noise in half. Render times can be on the order of an hour using 8 modern CPU cores for a simple scene.

There are more advanced monte carlo path tracing techniques that let you get better images more quickly, such as importance sampling, or denoising the image after it's rendered.

Monte carlo path tracing can make photorealistic images and gives you many advanced rendering features just because it follows physical laws so gives realistic results.

You can read more about it here:
<http://blog.demofox.org/2016/09/21/path-tracing-getting-started-with-diffuse-and-emissive/>

Here is an example image, which took about an hour to render using all 8 of my cpu cores:

[![enter image description here](https://i.sstatic.net/EacNQ.png)](https://i.sstatic.net/EacNQ.png)


---

