How does this work?
For RT to be used, we need to build and maintain a so called “Bounding Volume Hierarchy” (BVH). BVH is a triangulated representation of the whole world where all RT effects can work on that. Many games cut corners on what to include in BVH and what fidelity. Like only using less detailed models, removing everything at a relatively close distance. But that has a price. With such approach, it’s impossible to get accurate shadows. With War Thunder, we decided to go for the real deal, so we can employ a wider range of effects in the long run. In War Thunder, almost the whole battlefield is accessible for RT effects at the same fidelity that is rendered in the game, so all of those effects can be physically correct and accurate.
Doing this has a price as the BVH building process makes use of as many CPU threads as possible, so a modern CPU is recommended.
Now we have BVH ready, we can start tracing rays in it and get some effects out of it. We have three main effects available at launch.
Ray Traced Shadow Map (RTSM)
This replaces texture based shadow mapping and instead traces rays from every point on the screen onto the surface of the sun. As it’s using the whole surface of the sun, and not just the center point of it, shadows get a physically correct penumbra, depending on the shadow caster object’s distance, as one would expect.
The result is physically correct and pixel perfect shadows from the sun.
On high end GPUs one can also try shadows from dynamic lights. It enables hard, pixel perfect shadows from all dynamic lights, like explosions, muzzle flashes and the like. This is a very demanding feature, and aimed for high-end GPUs.
Ray Traced Ambient Occlusion (RTAO)
Ambient occlusion is a technique used to simulate object features blocking the ambient lighting, like the sky itself — a sort of ambient shadow. That’s why it’s darker under your bed.
Traditionally we do this with screen space techniques like SSAO or GTAO. RTAO is a ray traced version of these screen space techniques, and can correct errors, typical to screen space techniques, like when something casts ambient shadows outside of the screen. Screen space techniques can’t deal with that, but RTAO can. Similarly to when something casts ambient shadows, which is occluded by another object. Usually in these cases, you see shadows where it should not be, or vice versa. RTAO fixes all of these issues.
Ray Traced Reflection (RTR)
This is the most complex feature. RTSM and RTAO is really just about shadows, but with RTR, we’re visualizing BVH itself. In a mirror, you basically see what is in BVH and we’re working hard to make it match the rendered image closely as possible. Again, even before RTR, we had reflections. Probe based and screen space reflections were used, but just as with SSAO, they have their limitations. Actually very similar. Handling out of screen or occluded objects for screen space, and positioning issues with probes. RTR has the whole scene to trace, so naturally it can reflect objects from any location. There is another complication for RTR, namely surface roughness. A rough surface like concrete has reflections which are very soft and blurry, while gloss surfaces like glass or flat water has mirror like sharp reflections. Additionally, there’s everything in between. Simulating this is actually one of the hottest topics in computer graphics. Our approach is rendering noisy reflections based on roughness, and using a so called denoiser to get physically accurate reflections. The effect is sometimes obvious, like in the case of mirror like reflections.
Other times, it’s less obvious but makes the rendered image just more correct, making it look natural. If you look at these shots, take a look at the vehicle and its surroundings. On the non RT one, it is basically glowing in the shadow, as the building which should block the sky from the reflection on it is not on screen, so screen space techniques can’t know the sky should be blocked. On the RT version, this blue tint is gone, as BVH has the building, regardless of it being on screen or not, and blocks the sky correctly.
Again RTR is fixing the issues traditional screen space and probe based reflections have.
A sub feature of RTR is reflections on translucent glass surfaces. In these glass surfaces, you can now see an accurate reflection of the world, instead of the probe we used before. The result is accurate reflections again.
And finally another sub feature is reflections on water.
Our water reflections are using planar reflections in the game, which is a very accurate way to have reflections, and then it’s distorted based on the waves. With RTR water, the reflection rays are shot out correctly, based on the wave normal vectors. The reflection itself is simply more correct, as it’s not just distorting a 2D image, but actually use different reflections per pixel.
The difference is sometimes larger, sometimes smaller.
