Home 9 Software Development 9 Unreal Engine: What Is Real-time Ray Tracing

Unreal Engine: What Is Real-time Ray Tracing

Real-time ray tracing is heavy on performance. With high compatibility and complexity demand, it's a more resource-intensive process than traditional rendering techniques. Running this feature on an old piece of hardware isn't wise unless you want to prepare a British breakfast on your old graphics card. 
Daniel Zacharias

Ygor Ribeiro

March 1, 2023
ray tracing

Epic Games’ poster child, Unreal Engine 5, gave us some mind-blowing games: Fortnite, eFootball PES, The Matrix Awakens, and Cyberpunk 2077. But do you know what makes them so amazing, mouthwatering, and unreal? 

It’s real-time ray tracing!

What is this new cutting-edge technology every game developer is talking about? How does it allow such realistic, stunning visuals in real time? And how is it different from previously known rendering techniques? Let me answer all of these questions for you. 

What is real-time ray tracing?

Real-time ray tracing is a revolutionary game-development tech that Unreal Engine integrated into its hood. At its core, it’s a rendering technique that simulates how light behaves in the real world. It does this by tracing the path of light as it bounces off of different surfaces and objects in a scene. The envious benefit of ray tracing in real time is the creation of highly accurate and realistic lighting, shadows, reflections, and refractions.

Okay, so it’s a tool that gives us more realistic video graphics. But if that’s all it does, how didn’t it appear in the gaming industry years ago? What stopped real-time ray tracing from being used sooner? 

Here’s the truth: Ray tracing was a computationally intensive process that required significant time and resources to render a single frame. It was impractical to use it in real-time applications, such as video games, which require a high frame rate to provide a smooth, immersive experience for the player. 

Back then, the graphics processing hardware and software weren’t so advanced. That all changed when ray casting, a predecessor of real-time ray tracing, came into town. 

What was fresh about this tech is that it involves casting rays from the camera into the scene and intersecting them with objects and surfaces. This gave birth to the creation of a 3D map of the scene, used to generate realistic lighting and shading.

After that, Unreal Engine 5 disrupted the game industry by taking this tech and spicing it up with two features: 

  • Nanite creates highly detailed and complex geometry with a minimal performance impact.
  • Lumen is a global illumination system that accurately simulates how light behaves in a scene.

What are the benefits of real-time ray tracing

Thanks to Nanite and Lumen, these are the benefits real-time ray tracing brought us: 

  • Realistic visuals for the gaming, film, and architecture industries — visually stunning graphics in real-time found a new place in special effects of the film industry. It also helped achieve new levels of realism in architectural visualization and, of course, in gaming graphics.
  • Use of more complex and dynamic lighting scenarios — With traditional rendering techniques, it’s nearly impossible to create realistic lighting that changes over time or in response to moving objects. Real-time ray tracing changed that by reacting realistically with the movement of elements and the position of characters.
  • Reflections, shadows, and visual fidelity levels up — Ray-traced reflections and shadows followed by global illuminations lit up the game development field with a better immersive experience and increased believability. High visual fidelity accurately simulates how the light interacts with different objects in a scene, thus playing tricks on your mind of what’s real.

How real-time ray tracing works in games

Traditionally taught in graphic schools, a 3D scene is rendered by tracing the path of light as it bounces off of different objects in the scene. It’s done using a process called “rasterization.” The scene is divided into small pixels, and each pixel is filled with a color based on the objects and lighting in that area.

That’s so 20th-century game outlook, right?

Here’s a new perspective: You’re standing in a room, wanting to know what’s on the other side of the wall. You could try to poke your head through a small hole, but that doesn’t give you a better view. Or, you could use a flashlight to shine a beam of light through the hole and see what it hits. 

This is how real-time ray tracing works in computer graphics. Instead of a flashlight, it uses virtual “rays” of light to simulate how light would behave in the virtual world the system is rendering. Rays are traced through the virtual scene, bouncing off surfaces and interacting with objects like natural light. 

The result of the process? More accurate, realistic, and stunning game graphics that’ll make you question whether the game you’re playing is real or not! 

Fun fact: Real-time ray tracing traces millions of rays in a fraction of a second. That’s what the true rendering power looks like.

And you know what’s even crazier? 

All that power is unleashed in Unreal Engine 5 with a click of a button. It’s a feature that is enabled in the engine’s rendering settings. Using the various ray tracing effects this feature brings, game devs finally have the chance to push the visuals of their project to a whole new level. 

These effects include:

  • Ray-traced reflections — accurately reflect the environment and lighting in a scene
  • Ray-traced shadows — shadows that behave realistically based on the position of the light source

Does real-time ray tracing have a bad side?

Everything about real-time ray tracing seems fantastic. This explains why every game dev wants to take this sexy thing out for a spin. But what’s the bad side of real-time ray tracing? 

Reading the performance report: Real-time ray tracing is heavy on performance. With high compatibility and complexity demand, it’s a more resource-intensive process than traditional rendering techniques. Running this feature on an old piece of hardware isn’t wise unless you want to prepare a British breakfast on your old graphics card. 

Real-time ray tracing – a recap of Unreal Engine’s secret weapon

Despite potential drawbacks, real-time ray tracing is Unreal Engine 5’s powerful tool that will increase in popularity.

Mind-bending graphic visuals that break complex geometries with algorithms and shadows that make the game more immersive are just tiny perks this impressive feature brings.  

Get the best of Code Power News in your inbox every week

    You may also like

    Principles and Benefits of Reactive Programming

    Principles and Benefits of Reactive Programming

    Unlike traditional programming, reactive programming revolves around asynchronous data streams. However, code is usually written linearly, one step after another. Reactive programming offers a way for developers to deal with scenarios where events occur unpredictably...

    Get the best of Code Power News in your inbox every week