GamingGPUsNews

Path Tracing vs. Ray Tracing: What is the Difference?

Over the last few years, NVIDIA has made RTX (a marketing term for ray tracing) a household name. But ray tracing isn’t the true holy grail of computer graphics. There’s a higher realm called path tracing. While similar to ray tracing in implementation, path tracing does the same thing as ray tracing but does it recursively for significantly better results.

A while back, CD Projekt Red rolled out a path-tracing update for Cyberpunk 2077. However, it’s not the first to support it. There have been multiple titles to support it in the past. Notable mentions include Portal RTX, Quake RTX, and Metro Exodus Enhanced Edition.

The primary difference between ray tracing and path tracing boils down to the post-intersection stage. The rays are first cast into the scene through the viewport. Each ray is tested against the BVH structures of the objects in the scene for intersection, namely a hit or a miss. With ray tracing, this is the last step, followed by the necessary calculations and shading of the pixel in question. Path tracing repeats the intersection stage multiple times to gather additional data before returning with the results.

In practice, a path-tracing ray is usually treated as multiple ray tracing rays that pick off right where the first one ends. Suppose you have a mirror or a shiny metal frame. A path-tracing ray would strike it once, get reflected, and bounce off to a nearby object as a second independent ray. In this case, it would also act as a secondary light source.

In path tracing, light-reflecting objects also behave as secondary light sources. As a result, the total number of luminous objects affecting the lighting of the scene significantly increases. Each point source of light gets its own shadow, and the number of rays present in the scene simultaneously increases triple or quad-fold.

Path tracing generally makes the scene more illuminated as the additional ray bounces result in better penetration of the light rays. This is especially notable in indoor scenes. Here are some examples of how path-traced global illumination improves image quality. You may click on the image to view the high-resolution version:

Path Tracing

The impact of path tracing is most prominent in indoor scenes, with exteriors also getting a decent uplift at night. The above example shows that the vegetation and other complex structures are shadowed much more accurately with path tracing.

Ray Tracing
Path Tracing

In the above shot, you can see that path tracing also affects the outside. The sun’s rays better illuminate the scene, adding a slight orange tint to the concrete structures. Dense vegetation is also better shaded.

Ray Tracing
Path Tracing

Here’s an example where path tracing has less of an impact on image quality. While the shadows and AO are more accurate, it’s not something that you’ll notice unless you know what to look for.

Ray Tracing

Here are two interior scenes where path tracing adds a fresh coat of paint, transforming the image altogether:

Path Tracing

The penthouse looks very well-lit with path tracing, while ray tracing looks dim and lifeless. This is path traced global illumination at its best. The artificial light sources (electric lighting) are diffused uniformly, making the lighting look more realistic. Indirect lighting or multiple bounce lighting is called diffuse illumination.

Ray Tracing
Path Tracing

Here’s another example of indoor diffuse lighting. Path tracing results in better ambient shadows where the lighting is well-spread in lit areas while keeping the obstructed ones dark.

Ray Tracing

Further reading:

Areej

Computer hardware enthusiast, PC gamer, and almost an engineer. Former co-founder of Techquila (2017-2019), a fairly successful tech outlet. Been working on Hardware Times since 2019, an outlet dedicated to computer hardware and its applications.

Related Articles

Back to top button