Ray tracing is a rendering technique that calculates how light interacts with objects in a digital scene to produce realistic images. The technique traces the path of simulated light rays as they travel from a camera or viewpoint, strike surfaces, and interact with materials in the scene. Ray tracing reproduces physical lighting behaviour, including reflections, refractions, shadows, and global illumination, with a level of accuracy that traditional rendering methods cannot match.
Computer graphics artists, game developers, and visualization professionals use ray tracing to generate photorealistic imagery for film, architectural visualization, product design, and video games. Film studios have relied on offline ray tracing for decades to render computer-generated visual effects. Game developers began adopting real-time ray tracing after dedicated graphics hardware made the technique fast enough to run during gameplay.
Ray tracing differs from rasterization, the conventional rendering method used in most real-time graphics. Rasterization projects 3D geometry directly onto a 2D screen and approximates lighting with pre-calculated or simplified techniques. Ray tracing instead simulates individual light paths, which produces more accurate reflections, shadows, and indirect lighting at a higher computational cost.
This article explains how ray tracing works, how graphics hardware accelerates the technique, how it appears in video games, which software tools support it, and how it compares with rasterization.
What Does Ray Tracing Mean?
Ray tracing refers to a rendering algorithm that simulates the physical path of light by tracing rays from a viewpoint through a scene to calculate colour, shadow, and reflection data for each pixel. The term describes both the underlying algorithm and the broader family of rendering techniques built on it, including path tracing and ray casting.
Each ray represents a line that travels through the scene and interacts with the surfaces it encounters. When a ray strikes an object, the rendering engine calculates the object’s colour, texture, and material properties at that point. The engine then generates additional rays to determine reflections, refractions, and shadows based on nearby light sources and surfaces.
The word “tracing” describes the process of following a ray’s path as it bounces between surfaces. A single primary ray can generate multiple secondary rays, forming a branching structure often called a ray tree. This structure allows the renderer to account for indirect lighting effects that rasterization cannot reproduce without additional approximation techniques.
How Does Ray Tracing Work?
Ray tracing works by casting rays from a virtual camera through each pixel of an image, calculating where those rays intersect scene geometry, and computing the resulting colour based on material properties, lighting, and additional rays generated at each intersection point. The process repeats for every pixel in the final image, producing a complete rendering once all ray paths resolve.
The core ray tracing pipeline consists of four sequential stages. The renderer casts a primary ray from the camera through each pixel, tests that ray against scene geometry to find the nearest intersection, calculates shading based on the material and any light sources at that point, and generates secondary rays to capture reflection, refraction, or shadow information. Recursive ray tracing repeats this cycle for each secondary ray until a defined depth limit or termination condition is reached.
Rendering engines vary the number of rays per pixel, the maximum ray depth, and the sampling method depending on the required image quality and available computing power. Offline renderers used for film production can trace hundreds of rays per pixel, while real-time ray tracing in games limits ray counts to maintain playable frame rates.
Casting Rays from the Camera
Casting rays from the camera is the first stage of the ray tracing pipeline, in which the renderer projects a primary ray from the camera’s viewpoint through each pixel of the output image into the 3D scene. Each primary ray corresponds to exactly one pixel, so a 1920×1080 image requires more than two million initial rays before any secondary rays are generated.
The camera model determines the direction and origin of each ray. A perspective camera fans rays outward from a single point, which produces the converging perspective seen in standard photography and most rendered scenes. An orthographic camera casts parallel rays, which removes perspective distortion and is commonly used in technical and architectural renders.
The renderer records the direction of each primary ray so it can calculate what the ray intersects as it travels through the scene. This directional data feeds directly into the ray-object intersection stage.
Ray-Object Intersection
Ray-object intersection is the calculation that determines which surface a ray strikes first as it travels through a 3D scene, along with the exact point, distance, and surface normal at that location. The renderer tests each ray against the scene’s geometry and returns the closest valid intersection, since only the nearest surface along a ray’s path is visible to the camera.
Testing every ray against every object in a scene individually would be computationally impractical for scenes containing millions of polygons. Rendering engines instead organize scene geometry into spatial data structures, such as bounding volume hierarchies (BVH) or k-d trees, that group nearby objects together. These structures let the renderer skip large regions of empty space and test only the objects near a ray’s actual path, which reduces intersection calculations by several orders of magnitude compared with brute-force testing.
Once the renderer identifies the closest intersection point, it retrieves the surface normal, material identifier, and texture coordinates at that location. This information passes to the shading stage, where the renderer calculates the resulting colour.
Shading, Reflection, and Refraction
Shading, reflection, and refraction are the calculations a ray tracing renderer performs at each intersection point to determine a surface’s final colour based on its material properties, incoming light, and any additional rays the surface generates. Shading calculates the base colour and brightness of a surface using its material definition and the light sources that reach that point. Reflection generates a secondary ray that follows the mirror angle from the surface, capturing what other objects appear in a shiny or metallic surface. Refraction generates a secondary ray that bends as it passes through a transparent or translucent material, following the same physical principle that bends light through glass or water.
A single intersection point can spawn several secondary rays at once. A glass object, for example, generates both a reflection ray and a refraction ray at each surface it encounters, and each of those rays may generate further secondary rays as it continues through the scene. Shadow rays form a separate category: the renderer casts a ray from the intersection point toward each light source to determine whether the point lies in shadow, blocking direct illumination when another object obstructs the path.
Material properties control how a surface responds during shading. A rough, diffuse material scatters light in many directions and produces soft, even shading, while a smooth, specular material reflects light in a concentrated direction and produces sharp highlights and mirror-like reflections.
Bouncing Rays and Global Illumination
Bouncing rays and global illumination describe the process by which a renderer traces multiple sequential light bounces between surfaces to reproduce indirect lighting effects, such as colour bleeding and ambient light transfer, that direct illumination alone cannot capture. Each time a ray strikes a diffuse surface, the renderer can generate an additional ray that samples light arriving from other surfaces in the scene, rather than only from direct light sources.
Global illumination accounts for light that reaches a surface after reflecting off one or more other surfaces first. A red wall positioned next to a white object causes the object’s surface to take on a subtle red tint in a scene rendered with global illumination, an effect known as colour bleeding. Rasterization-based renderers typically approximate this effect with pre-baked lighting data, while ray tracing calculates it directly by following the actual bounce paths.
Path tracing, a related technique developed by Jim Kajiya in 1986, extends ray tracing by using randomized (Monte Carlo) sampling to trace many possible bounce paths per pixel and average the results. Path tracing produces highly accurate global illumination but requires substantially more computation than simpler ray tracing implementations, which is why real-time applications limit the number of bounces to maintain performance.
Hardware-Accelerated Ray Tracing
Hardware-accelerated ray tracing uses dedicated processing units built into a graphics card to perform ray-object intersection and related calculations directly in silicon, rather than through general-purpose shader cores. This dedicated hardware allows ray tracing to run at frame rates suitable for interactive applications, including video games, which earlier software-based ray tracing implementations could not sustain.
Before dedicated hardware existed, ray tracing calculations ran on general-purpose CPU or GPU shader cores, which made real-time ray tracing impractical for consumer applications. Dedicated ray tracing hardware changed this limitation by handling the most computationally intensive parts of the pipeline, particularly bounding volume hierarchy traversal and ray-triangle intersection, in specialized circuits designed for that exact task.
What Is Hardware-Accelerated Ray Tracing?
Hardware-accelerated ray tracing is a rendering approach in which a graphics processor contains dedicated circuits that perform ray-intersection calculations independently of the GPU’s standard shader cores. These dedicated circuits process bounding volume hierarchy traversal and ray-triangle intersection tests, which are the most repetitive and computationally expensive operations in the ray tracing pipeline.
Separating ray-intersection work from general shading work allows a GPU to perform both tasks in parallel. The shader cores continue handling rasterization, texturing, and standard shading calculations while the dedicated ray tracing hardware processes intersection tests simultaneously. This parallel architecture is what allows modern GPUs to combine ray-traced lighting effects with conventional rasterized rendering in the same frame, an approach known as hybrid rendering.
RT Cores and GPU Ray Tracing (RTX)
RT Cores are dedicated hardware units on NVIDIA GPUs that accelerate bounding volume hierarchy traversal and ray-triangle intersection calculations, forming the core hardware component of NVIDIA’s RTX ray tracing platform. NVIDIA introduced RT Cores with the GeForce RTX 20 series, announced in August 2018 and built on the Turing architecture, marking the first consumer graphics cards designed with dedicated ray tracing hardware.
The Turing architecture combined three specialized processor types on a single chip: CUDA cores for standard shading and rasterization, RT Cores for ray tracing acceleration, and Tensor Cores for AI-based calculations, including image upscaling. NVIDIA reported that Turing’s RT Cores processed several times more ray intersections per second than the shader cores in the preceding GTX 10 series performed without dedicated hardware. NVIDIA has continued to expand RT Core performance in each subsequent RTX generation.
AMD and other GPU manufacturers have since introduced comparable ray tracing hardware. AMD’s RDNA 2 architecture, used in the Radeon RX 6000 series and in the PlayStation 5 and Xbox Series X consoles, includes a Ray Accelerator unit within each compute unit that performs a similar intersection role to NVIDIA’s RT Cores.
Ray Reconstruction and Denoising
Ray reconstruction and denoising are AI-based processes that clean up and sharpen ray-traced images by filling in missing lighting detail from scenes rendered with a limited number of rays per pixel. Real-time ray tracing traces far fewer rays per pixel than offline rendering to maintain playable frame rates, which produces a noisy, grainy image that requires additional processing before it reaches the screen.
Traditional denoisers use hand-tuned algorithms to smooth out this noise, but they can blur fine detail or produce inaccurate lighting artifacts in complex scenes. NVIDIA introduced Ray Reconstruction with DLSS 3.5 in September 2023 as an AI-trained alternative to hand-tuned denoisers. The Ray Reconstruction model was trained on a substantially larger dataset than earlier DLSS versions and generates higher-quality pixels for reflections, shadows, and global illumination by recognizing lighting patterns learned from offline-rendered reference images.
Denoising and reconstruction techniques allow real-time renderers to trace a fraction of the rays that a fully converged offline render would require while still producing a stable, detailed final image. This capability is a primary reason real-time ray tracing became practical in consumer graphics hardware.
Ray-Traced Ambient Occlusion (RTAO)
Ray-traced ambient occlusion (RTAO) is a rendering technique that uses ray tracing to calculate how much ambient light reaches each point on a surface based on nearby geometry, producing accurate soft shadowing in corners, crevices, and contact points between objects. RTAO replaces screen-space ambient occlusion (SSAO), an older rasterization-based approximation that estimates occlusion using only the visible pixels on screen.
RTAO calculates occlusion by casting short rays outward from a surface point in multiple directions and measuring how many of those rays strike nearby geometry before reaching open space. A surface point surrounded by more nearby geometry receives darker ambient occlusion shading, while an exposed surface point receives little or no occlusion. Because RTAO samples actual scene geometry rather than only on-screen data, it produces consistent shadowing that does not disappear when objects move off screen, a common limitation of SSAO.
Game engines often combine RTAO with other ray-traced effects, such as reflections and shadows, or offer it as a standalone, lower-cost ray tracing option for hardware with limited ray tracing performance.
Real-Time Ray Tracing vs. Offline Rendering
Real-time ray tracing and offline rendering both trace light paths through a scene, but they differ in the number of rays calculated, the time allowed per frame, and the resulting image quality. Real-time ray tracing must generate a complete frame within milliseconds to maintain interactive frame rates, while offline rendering can take seconds, minutes, or hours per frame because no live interaction is required.
Real-time ray tracing, used in video games and interactive applications, limits ray counts per pixel and relies on AI-based denoising and upscaling to compensate for the reduced sample count. This approach produces a noisier initial image that denoising algorithms clean up before display. Offline rendering, used for film visual effects and pre-rendered animation, can trace hundreds or thousands of rays per pixel across many bounces, producing a fully converged, noise-free image without requiring denoising shortcuts.
Hardware constraints explain most of the remaining differences. Real-time ray tracing runs on consumer GPUs that must also handle rasterization, physics, and game logic within the same frame budget. Offline rendering typically runs on dedicated render farms with hundreds or thousands of processor cores, where a single frame can be distributed across many machines without a fixed time limit. As a result, offline-rendered films can include ray-traced effects, such as full path-traced global illumination and volumetric lighting, at a fidelity that current real-time hardware cannot yet sustain during interactive gameplay.
Ray Tracing in Video Games
Ray tracing in video games refers to the use of real-time ray-traced lighting effects, such as reflections, shadows, and global illumination, layered on top of conventional rasterized rendering within a hybrid pipeline. Game developers selectively apply ray tracing to specific lighting effects rather than rendering an entire frame with ray tracing alone, since a fully ray-traced frame at high resolution and frame rate remains beyond the performance budget of most gaming hardware.
Battlefield V was among the first major titles to ship with real-time ray-traced reflections following the release of the GeForce RTX 20 series in 2018. Since then, ray tracing support has expanded across major game engines, including Unreal Engine and CryEngine, and has become a standard graphics option in many AAA titles released on PC and current-generation consoles.
How to Turn On Ray Tracing
To turn on ray tracing, open a game’s graphics settings menu and enable the ray tracing option for supported effects, such as reflections, shadows, or global illumination, then confirm the changes to apply the new settings. Most PC games list ray tracing as a separate settings category from standard graphics options, since it requires compatible hardware and carries a distinct performance cost.
Ray tracing requires a graphics card or console with dedicated ray tracing hardware, along with a game engine and title that support the DirectX Raytracing (DXR) or Vulkan Ray Tracing API. Players should update their graphics drivers to the latest version before enabling ray tracing, since GPU manufacturers frequently release driver updates that improve ray tracing performance and compatibility for newly released games. Console players typically toggle ray tracing through an in-game performance or graphics mode selector rather than a detailed settings menu.
Does Ray Tracing Reduce FPS?
Ray tracing reduces frames per second (FPS) because it adds substantial computational overhead to each rendered frame, and the size of that reduction depends on the graphics hardware, the specific ray-traced effects enabled, and the game’s resolution. Ray-traced reflections, shadows, and global illumination each require additional ray-intersection calculations beyond standard rasterization, so enabling multiple effects at once compounds the performance cost.
The magnitude of the FPS reduction varies by hardware generation and by how many ray tracing effects a game enables simultaneously. A GPU with dedicated ray tracing hardware, such as an RT Core-equipped RTX card, experiences a smaller FPS reduction than a GPU without dedicated ray tracing acceleration attempting the same workload through software. AI-based upscaling and frame generation technologies, including DLSS and comparable tools from other GPU manufacturers, offset much of this performance cost by rendering at a lower internal resolution and reconstructing a higher-resolution output frame.
Players who experience an unacceptable FPS drop with ray tracing enabled can reduce the number of active ray-traced effects, lower the ray tracing quality preset, or enable an upscaling technology rather than disabling ray tracing entirely.
Ray Tracing on Consoles (PS5)
The PlayStation 5 supports hardware-accelerated ray tracing through its custom AMD RDNA 2-based GPU, which includes a dedicated ray tracing accelerator within each of its compute units. Sony’s system architect, Mark Cerny, confirmed at the console’s technical reveal that ray tracing acceleration runs in dedicated GPU hardware rather than through software-based workarounds.
The PS5’s GPU operates at a variable frequency of up to 2.23 GHz, delivering up to 10.3 teraflops of compute performance across 36 active compute units. Game developers use this ray tracing hardware for effects including reflections, shadows, and positional audio calculations, typically applying ray tracing selectively within a hybrid rendering pipeline similar to the approach used on PC. Because console hardware offers less raw ray tracing throughput than a high-end PC graphics card, PS5 titles generally apply ray tracing to a narrower set of effects or offer a separate performance mode that disables ray tracing in favour of a higher frame rate.
Ray Tracing Software and Rendering Tools
Ray tracing software and rendering tools include game engines, offline renderers, and graphics APIs that implement ray tracing algorithms for interactive or pre-rendered content. These tools fall into two broad categories: real-time engines built for games and interactive applications, and offline renderers built for film, animation, and static visualization work.
Unreal Engine and Unity are the leading real-time game engines that support hardware-accelerated ray tracing, offering built-in ray-traced reflections, shadows, and global illumination features that developers can enable through the engine’s rendering settings. Offline renderers designed for film and visualization include Arnold, V-Ray, RenderMan, Cycles, and Octane, each of which implements ray tracing or path tracing to generate photorealistic frames for animation, visual effects, and architectural visualization projects.
Graphics APIs provide the underlying interface that connects rendering software to GPU ray tracing hardware. Microsoft’s DirectX Raytracing (DXR), introduced alongside the GeForce RTX 20 series in 2018, and the cross-platform Vulkan Ray Tracing extension allow developers to access dedicated ray tracing hardware across supported GPUs from multiple manufacturers, rather than writing hardware-specific ray tracing code for each graphics card.
A Brief History of Ray Tracing
The history of ray tracing traces from early academic research in the late 1960s through recursive ray tracing algorithms in the 1980s to the introduction of consumer real-time ray tracing hardware in 2018. Arthur Appel published the first computational approach to ray tracing in 1968, using ray casting to solve visibility and shadow calculations for rendering solid objects.
Turner Whitted extended this foundation in 1980 with a recursive ray tracing algorithm, published in the paper “An Improved Illumination Model for Shaded Display.” Whitted’s technique introduced the ability to simulate reflections and refractions by recursively tracing secondary rays from each intersection point, establishing what remains known as Whitted-style ray tracing. Robert Cook introduced distributed ray tracing in 1984, adding support for effects such as soft shadows, motion blur, and depth of field through randomized ray sampling. Jim Kajiya formalized path tracing and the rendering equation in 1986, providing the mathematical basis for modern physically based global illumination.
Throughout the 1980s and 1990s, ray tracing remained largely confined to offline rendering for film and academic research due to its high computational cost. Pixar’s RenderMan software, developed in the late 1980s, brought ray tracing techniques into mainstream animation production. Real-time ray tracing became commercially viable for consumer hardware in August 2018, when NVIDIA announced the GeForce RTX 20 series, the first consumer GPU line built with dedicated RT Cores for hardware-accelerated ray tracing.
Ray Tracing vs. Rasterization
Ray tracing and rasterization are the two primary rendering methods used in computer graphics, and they differ in how they calculate what appears on screen: ray tracing simulates individual light ray paths, while rasterization projects 3D geometry directly onto a 2D image plane and approximates lighting separately. Rasterization has served as the standard method for real-time graphics for decades because it requires substantially less computation than ray tracing.
Rasterization converts each 3D polygon in a scene into pixels on the screen through a geometric projection process, then applies lighting, shadows, and reflections using pre-calculated techniques such as shadow maps, cubemaps, and baked lighting data. These techniques approximate realistic lighting but cannot fully reproduce accurate reflections of off-screen objects, physically correct refraction, or dynamic global illumination without significant additional engineering. Ray tracing calculates these same effects directly by tracing actual light paths, which produces more physically accurate results at a higher computational cost per frame.
Modern game engines commonly use a hybrid approach that combines both methods within the same frame. The engine rasterizes the base scene geometry for performance, then layers ray-traced effects, such as reflections, shadows, or ambient occlusion, on top of the rasterized image for the specific effects that benefit most from ray tracing’s accuracy. This hybrid pipeline balances the performance advantages of rasterization with the visual accuracy of ray tracing, and it remains the standard approach for real-time ray tracing in current games and applications.



