Categories
Articles Hardware/Tech

Everything you need to know about ray tracing

You may have heard about this new technology called ray tracing that’s revolutionizing graphics in games. Ray tracing is a rendering technique that creates much more realistic lighting and shadows compared to traditional techniques. It mimics the way light works in the real world to give games a major glow up.

The visuals in games have gotten so much better over the years, with insanely detailed textures, environments, and characters. But lighting has always been a challenge. Developers have had to use shortcuts and approximations to simulate how light bounces around a scene. These old techniques often resulted in flat or unrealistic looking lighting, with harsh shadows and environments that didn’t quite feel alive.

Ray tracing fixes all that by actually tracing the path of light rays as they bounce around the scene. It keeps track of the way light interacts with objects, scatters, reflects, and illuminates surfaces. This means light will fall naturally on surfaces, bounce around the environment, and create soft, realistic shadows. Mirrors and other reflective surfaces also become much more true to life. The end result is a level of photorealism we haven’t seen before in games.

ray tracing

Of course, ray tracing isn’t exactly new. It’s been used for years in movies and TV to create stunning CGI effects. But video games have traditionally shied away from ray tracing because it requires an immense amount of graphical processing power to calculate light paths and reflections in real time. Recent advancements in GPU technology, like NVIDIA’s RTX line of graphics cards, have finally made ray tracing possible in games.

Several big games have already rolled out ray tracing support, with more on the way. In Shadow of the Tomb Raider, ray tracing is used to render realistic shadows that soften or sharpen based on the lighting. Metro Exodus uses ray tracing for advanced light scattering and ambient occlusion, bringing its post-apocalyptic environments to life.

Perhaps the game that showcases ray tracing the best so far is Control. Nearly every surface in the game’s bizarre brutalist setting is reflective, and light interacts naturally with the environments. Raytraced reflections are rendered in real time, so you’ll see the main character, Jesse Faden, reflected in screens, floors, and other surfaces as she walks by. The game almost feels like a tech demo for ray tracing, but it’s a fun and unsettling game in its own right.

How does it work?

Ray tracing simulates the way light travels in the real world. It traces the path of light rays as they bounce off objects, scatter, and reflect in a scene. This allows for hyper-realistic lighting, shadows, reflections, and ambient occlusion.

This method calculates the color of each pixel on the screen by tracing light rays back to their source. It determines which objects the rays intersect with along their path, and how the light should interact with those surfaces. This produces the most natural looking lighting of any rendering technique.

ray tracing

Ray tracing starts by generating primary or camera rays from the viewer’s eye or camera into the virtual 3D scene. These rays will intersect with objects in the scene and then secondary rays are spawned to simulate effects like reflections and shadows. The process of ray tracing repeats recursively until the rays are too faint to make any impact on the final image.

When a ray intersects with an object in the scene, the object’s material properties are checked to determine what happens to the ray. Highly reflective objects like mirrors will spawn reflection rays, translucent materials will spawn refraction rays, while opaque objects will terminate that particular ray. Many secondary rays can stem from just one primary ray, so the complexity of a ray traced scene grows exponentially.

Reflection rays simulate mirror-like reflections by emitting a new ray at an angle that is equal and opposite to the incident ray. This new reflection ray is then tested against the scene to see if it intersects any other objects and spawns more rays of its own. Refraction rays simulate the bending of light through transparent materials like glass based on Snell’s law of refraction.

Shadow rays are also emitted to test if a point or surface is in shadow or not. When a shadow ray hits an occluding object, that surface is marked as being in shadow for that light source. Global illumination effects like soft shadows, reflections of reflections, and diffuse interreflections emerge naturally from the recursive nature of ray tracing.

ray tracing

Cons of ray tracing include the heavy computational cost due to the exponential growth in the number of rays. The process scales poorly with scene or image resolution, so high-resolution ray tracing can take hours or days to render a single frame. Many acceleration techniques exist to improve performance, including bounding volume hierarchies, spatial partitioning, and Monte Carlo sampling.

Who does it better? Nvidia vs AMD

In the last few years, both Nvidia and AMD have introduced hardware-accelerated ray tracing capabilities in their graphics cards. However, there are key differences in their approaches and performance that are worth considering.

Nvidia was the first to offer dedicated ray tracing hardware with their RTX 20 series graphics cards released in 2018. These cards integrate ray tracing cores directly onto the GPU die to accelerate the ray-triangle intersection tests required for ray tracing. The RT cores can perform up to 6 trillion intersection tests per second, providing the performance needed for real-time ray tracing.

Nvidia’s implementation uses a combinational approach, with both the ray tracing cores and traditional CUDA cores working together on the ray tracing workload. The RT cores handle the complex ray tracing tasks while the CUDA cores take care of game logic, AI, and post-processing effects. This leverages the full power of the GPU for real-time ray tracing games and applications.

AMD’s RDNA 3 architecture aims to close this gap through the introduction of dedicated ray accelerators for the first time. Previously, AMD relied solely on the raw shader performance of its GPU cores to handle ray tracing. But with RDNA 3, specialized ray tracing hardware is finally coming to AMD cards.

ray tracing

Early reports suggest there will be up to 128 ray accelerators on the top Navi 31 GPU, similar to Nvidia’s RT core count. AMD claims this dedicated hardware along with optimizations in their compute shader code could deliver a 2x improvement in ray tracing performance over the current generation.

However, even with a 2x gain, AMD’s ray tracing performance may still trail Nvidia’s larger 3-5x increase with Ada Lovelace. Nvidia will likely maintain its performance leadership at the high end, though AMD closing the gap could make its 7000 series more competitive for ray tracing workloads.

Does it worth it?

Nvidia’s RTX cards with dedicated ray tracing cores can cost hundreds more than comparable cards without them. And to really take advantage of ray tracing, you’ll also need a CPU and fast RAM to keep up. This upgraded hardware comes at a substantial cost.

So the question becomes – is it worth paying so much more for graphics cards and systems with ray tracing capabilities? The answer depends a bit on your priorities.

ray tracing

For most casual gamers, ray tracing is probably not worth a significant investment right now. The performance impact and visual differences in most games are still relatively minor. Ray tracing can produce more realistic reflections, shadows, and lighting, but many games without it still look great.

However, for enthusiasts who really value the most photorealistic graphics possible, ray tracing may be worth a premium. Games that implement it well, like Control, Metro Exodus and Cyberpunk 2077, really showcase how transformative ray tracing can be for visual fidelity. If you have a high-end 4K or 8K display, ray traced effects will make more of a visible difference as well.

Overall, ray tracing is still a relatively niche feature that does not fundamentally change the gaming experience for most people. The performance impact is also noticeable, even on high-end hardware. But as ray tracing matures and improves, the value proposition will only increase, as it already began by PS5 and Xbox SX ray tracing capabilities. after all it is only the matter of accessibility for wider audience.   

So for now, ray tracing is probably not worth a major investment purely for that feature alone. But if you were already looking to upgrade your hardware for other reasons, selecting components with ray tracing support will allow you to benefit from this promising rendering technique now and in the future as it continues to progress.

Ray tracing isn’t quite mainstream yet, as you’ll need an expensive graphics card to experience it. But as the technology matures and becomes more affordable, expect to see ray tracing become the new industry standard for lighting and graphics in games. The next generation of gaming is going to be illuminated.

Also read: Indie games you can’t miss

What is ray tracing?

Ray tracing is a rendering technique that simulates the physical behavior of light to produce photorealistic images. It works by tracing the path of imaginary rays of light as they bounce around a virtual environment. This allows for realistic effects like reflections, refractions, shadows, and ambient occlusion.

Is ray tracing the future of rendering?

Many experts believe ray tracing will eventually replace rasterization as the primary rendering technique. This is because ray tracing produces the most photorealistic results by simulating actual light physics. As performance continues to improve through hardware advances, ray tracing will likely become practical for most rendering use cases.

What are the benefits of ray tracing?

The main benefit is realism. Ray tracing produces images that closely match what the human eye would actually see in the physical world. This is because it simulates how light actually behaves. Ray tracing also naturally produces effects like soft shadows, ambient occlusion, and caustics.

Subway Surfers

Shell Shockers

Crazy Roll

Minecraft

Cut the Rope

Solitaire

PUBG

Tunnel Rush

LOL Beans

slope game

Temple Run

Cat Trap Game

Free Racing

Moto X3M

Clash of Clans

Run 3

Snakes

Wordle