Ray Tracing 101: Everything You Need to Know
June 6, 2024Ray tracing is a cutting-edge technique in computer graphics used to create lighting effects that are much more realistic than traditional methods.
Imagine you’re in a room. Ray tracing works by mimicking how light behaves in the real world. It casts light rays out from the light source (like the sun or a lamp) and tracks their path as they bounce around the scene, interacting with objects.
Reflections: If a ray hits a shiny surface, it reflects off at an angle like a real mirror. This allows for realistic reflections like chrome surfaces or puddles.
Refractions: If a ray passes through a transparent object like glass or water, it bends, creating effects like light shimmering underwater or through a prism.
Shadows: Areas where the rays don’t reach become shadows, with soft edges and variations depending on the light source and object shapes.
Indirect Lighting: Light doesn’t just travel in straight lines; it bounces off surfaces and illuminates the scene indirectly. Ray tracing considers this, creating natural-looking lighting that fills the scene.
Traditional vs Ray Tracing
Previously, computer graphics relied on a technique called rasterization. This is faster but doesn’t simulate light as accurately. It often leads to flat lighting, unrealistic shadows, and blurry reflections.
Ray tracing offers a significant leap in visual quality, creating scenes that are much closer to real life.
Hyper-realistic lighting: Games and movies can achieve stunning visuals with accurate reflections, refractions, and natural-looking shadows.
Improved immersion: More realistic lighting enhances the feeling of being inside the game world or movie scene.
Cinematic effects: Ray tracing allows for advanced lighting techniques used in movies, creating a more polished and immersive experience.
Ray Tracing at home?
You can experience ray tracing at home, unfortunately this comes with a hefty price tag. You will need a beefy graphics card to go with the rest of a powerful personal computer. You will need a Nvidia RTX graphics card or AMD 6000 series card. Even then, not all games still support Ray Tracing. But in those that do, if you do not mind the performance spike, you can enjoy some nice visuals for an immersive experience. I do not recommend using Ray Tracing in multiplayer games unless you can skip the performance skip, because you can use the FPS boost from the traditional lighting effects.
Real applications
In most video games, they are not using real ray tracing, in actuality, they are using something called rasterization, which is a blend of the traditional and ray tracing techniques. In some way, you could say that the game is ‘cheating’ because it uses smart approximations as to where the light rays should end up, especially the real-time games, because we are still not ready for ‘real’ ray tracing. Although Ray Tracing has been used in the movie industry for decades, it used to need hundreds of machines all working hours to render a single movie. Real-time applications back then were unthinkable. Think about Avatar which was the first movie to successfully implement 3D imaging, and the shimmering water that’s still on my mind all these years later. Although I do not remember much of the plot, the stunning visual effects stayed with me all these years.
The technology behind Ray Tracing
Ray tracing relies heavily on complex mathematics to calculate the path of each light ray and its interactions.
In the context of ray tracing, a ray is a mathematical construct used to represent the path of light. It essentially carries information about the direction and origin of light as it travels through a virtual scene.
Imagine throwing a pebble into a still pond. The ripples emanating outwards from the point of impact represent the rays of light traveling through the scene. The pebble itself is like the starting point (origin) of the ray, and the ripples spreading outwards represent the direction the light travels. By tracing these “ripples” and how they interact with objects (like hitting the edge of the pond or encountering a rock), we can understand how light would behave in that real-world scenario. Traditionally, ray tracing calculations were very demanding on computer processing power. Modern graphics cards (GPUs) now come with specialized hardware units called RT Cores that significantly accelerate ray tracing calculations, making it more feasible for real-time applications like games. Newer Nvidia RTX 4090 cards ‘cheat’ even more because they introduced a concept called SER – Shader Execution Reordering, Nvidia even promises that the RTX 4080 has a 25% performance boost.
So far, Ray Tracing has mostly been hovering around the PC industry, but it has been making breakthroughs in other industries too, recently Apple announced that the A17 Bionic chip is going to be capable of ray tracing including in games.
How this technology develops remains to be seen, but we will be following it closely and keep you updated on the new developments in the everlasting search for photorealism in games. Below you can find our list of games that we recommend trying Ray Tracing on, if you can afford it that is.