2020: The year of Real Time Ray Tracing
By: Daniel Rose
Tags: Lighting, Gamedev, Art, Ray Tracing, Art Stories

It’s important to note that DXR is a feature of DirectX 12 and isn’t unique to Nvidia. Nvidia however has engineered its hardware to support and accelerate this spec. It’s even possible for many GTX 1060 or higher series owners to get a taste of what real time ray tracing can do-earlier in 2019 Nvidia enabled those cards to process DXR calculations via the shading core. Just be warned, it’s incredibly slow.

Along similar lines, Epic’s Unreal Engine is on the bleeding edge of supporting real time ray tracing. It’s 4.22 release in early 2019 finally brought ray tracing to users of the engine, enabling game developers to test it out with their titles. At the time, I was working on product visualizations for Dreamline. I immediately got to work implementing ray tracing into my workflow and thanks to some tips and tricks from Epic’s helpful tutorials, was able to get very high quality renders that came pretty close to my co-workers who were using Vray, all in significantly less time (on a GTX 1070 no less).

It should also be noted that Unity and Crytek, the makers of Unity and CryEngine respectively, are also working on their own ray traced rendering options as well. Unity has ray tracing available in preview currently, and Crytek plans to ship their implementation in 2020.

CryEngine’s Ray Tracing Demo

Unity’s Ray Tracing Demo

How do we develop for it?

I am going to using Unreal Engine for the frame of reference and example. I have more experience within that tool. Unity offers ray tracing support in 2019.3b, but it is currently in preview and is missing functionality whereas Unreal no longer considers ray tracing experimental.

Working with ray tracing from a development perspective is exciting, especially for someone like myself. I have experience with Arnold, V-Ray, and the now dead Mental Ray. I have shipped countless games and assisted on many experiences that use a variety of tools. Ray tracing coming to real time opens many more opportunities for the tools and workflows that I know to be adopted by many new industries.

Unreal’s Arch Viz learning scene with RT Enabled

Same scene with no RT and full Screen Space Reflections

It also introduces new challenges. What changes when you’re building a scene? Do I still need reflection probes? Do I still need light maps? Will this work with LODs? How much will this hit performance? Can my work machine keep up? Do I need to change my textures around?

On the asset side, 3D models have no changes to be made at all. If you’re making props or larger level geometry, the only real consideration will be if you have mesh holes that need to be closed because they are visible in the reflection. LOD’s don’t need to change either, they function just like they always have and will be visible in reflections and the like too.

Texture work doesn’t really need to change much either, although artists might want to take more care in how often they have highly reflective surfaces being mixed with non reflective surfaces on a model. This is an oversimplification, but noisy roughness maps with a high variance in roughness values affect what can be called ‘ray coherency’. This can be understood as the time it takes for ray calculations to render. Fully rough surfaces don’t need ray trace calculations done for reflections, while anything that is at or below the Max Roughness setting in a Post Process Volume will need some degree of additional calculation. Generally, it’s faster to either have a lot of reflective surfaces or very few, but not a noisy mix of both. Check out the video below for a more in depth explanation.

A great video covering almost all you need to know about Unreal’s Ray Tracing.

Unreal Engine’s current implementation allows users to set a roughness limit via a ‘Max Roughness’ setting in a Post Process Volume for both ray tracing and screen space effects. That setting tells the engine what the ‘cut off’ for ray traced reflections is as it were. Smaller values run faster as a roughness of .5 or less will be ray traced, and anything from .51 to 1 (MAXIMUM ROUGHNESS!!) will be using cube maps reflections generated by the reflection probes. This leads to another point as well; cube maps and shaders.

Cube map reflections are an absolute must today, and likely will be for some time. Ray tracing has the best visual improvements on highly reflective areas in a scene. For everything else that has moderate to no reflectivity, cube maps can continue to provide general reflection data. If you have a heavily smudged surface or a highly machined piece of metal with a very broad highlight, cube maps will suffice. In some limited testing, I’ve found .6 to be a solid setting for visualization scenes, while game scenes with more varied surfaces may work better at even lower thresholds.