War Thunder background
Ray Tracing in War Thunder!

With the Firebirds update, War Thunder has support for Ray Tracing (RT) and is capable of doing several RT based visual effects, like shadows, ambient occlusion and reflections. In today’s blog, we’ll be taking a closer look at the details!

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.

image

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.

Screenshot on the right is without the new RT effects

Screenshot on the left is with the new RT effects

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’s 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.

RT performance

Ray Tracing is heavy lifting, but there are many scalability options to make it more accessible.

First of all, all three options can be enabled/disabled independently, meaning you can use only the effect which you are care about the most if you have an older RT capable GPU.

Then there is the quality levels. In general, RTSM with dynamic lights is for the latest high end GPUs. Normally it’s not much more expensive than just sun shadows, but in the middle of the action with many fires and explosions, it can become very demanding.

For RTAO, low quality is using a lower internal resolution for the calculations. This is however the same resolution as with the screen space techniques, but without the screen space errors. Medium gives you higher resolution and high gives better de-noising. This is really only visible in certain circumstances, but we wanted to give you the control over it.

For RTR, low is a good tradeoff. It lacks RT shadows in reflections, improving speed considerably. Medium has RT shadows in reflections. Both low and medium is using a so called checkerboard rendering to double performance by tracing half the number of rays. High disables this checkerboard rendering, but the denoiser actually does a great job hiding the checkerboard pattern, so the difference is small. Again, it’s up to you to decide.

RTR also has a control to render at full or half resolution, both for water and normal surfaces. The difference is mainly visible in mirrors, and look good on half resolution even if you don’t have a beefier GPU.

Finally the RTR translucent glass reflections can also have RT reflections inside the reflections on high, or not on medium. This usually impacts performance slightly as these surfaces are not very common in the game.

For an optimized setting, where you get a good tradeoff on performance/image quality we recommend using the Medium RT preset. Pushing beyond further improves the quality of the effects but at greater price in performance. But if you have the latest top of the line GPU, go for it! :)

When using RT effects, we recommend using an upscaling anti aliasing method, with a preset that suits your graphics card. Like DLSS, FSR, XeSS or our TSR. With these upscalers you can achieve great performance and image quality. Balanced presets are usually a good middle ground for ray tracing, but on an older GPU, there’s nothing wrong in going for the performance preset if you want to enjoy the RT benefits.

We’re committed not just to add more RT features in the future, but also to improve the performance of existing ones, so stay tuned for future updates.

At launch, RT effects are supported on Nvidia graphics cards. Making it work on both AMD and Intel cards is a priority for us. It’s working with our internal builds, but not ready for release, we need to iron out some issues specific to these GPUs. It will be ready soon, along with the current generation consoles.

Read more:
Pre-order: RDF/LT and BMD-4M
  • 11 December 2024
M44: Big-Bore Bulldog
  • 11 December 2024
Squadron Vehicles: Su-33
  • 10 December 2024
New Location: Attica!
  • 9 December 2024

Comments (108)

Comments will be premoderated 
Commenting is no longer available for this news