Glossary term

Ray Tracing

What is ray tracing?

Ray tracing is an advanced rendering technique that simulates the physical behavior of light by tracking individual light rays as they interact with surfaces, creating realistic reflections, shadows, and ambient lighting for significantly more authentic virtual environments.

How does ray tracing work?

Ray tracing works as a computationally intensive approach that calculates how light rays travel from sources through an environment, accounting for reflections, refractions, scattering, and absorption based on material properties and physical light behavior.

The technology enables true global illumination where light bounces between surfaces, color bleeding where bright objects tint nearby surfaces, and physically accurate caustics from light focusing through refractive materials.

While historically too demanding for real-time applications, recent hardware advances and hybrid rendering approaches have made ray tracing increasingly accessible for interactive experiences.

Unity's own High Definition Render Pipeline (HDRP) has supported ray tracing since Unity 2019.3. See Unity's guide to getting started with ray tracing in HDRP for setup and hardware requirements.

Ray tracing vs. rasterization

Unlike rasterization, which approximates lighting effects, ray tracing models actual light paths to produce physically accurate results. Shadows show proper penumbra, reflections capture the surrounding environment, and refractions correctly bend light through transparent materials.

How it works
Ray tracing
Traces the actual path of light rays through a scene
Rasterization
Projects 3D objects onto a 2D plane and shades each pixel
Visual accuracy
Ray tracing
Physically accurate reflections, shadows, global illumination
Rasterization
Approximated with techniques like shadow maps and reflection probes
Performance cost
Ray tracing
Computationally intensive
Rasterization
Fast, the traditional standard for real-time rendering

Most modern implementations use a hybrid approach, applying ray tracing selectively to specific effects like reflections or ambient occlusion while relying on rasterization for everything else, balancing visual quality with performance.

How is ray tracing used?

Ray tracing is used across architectural visualization, product design, virtual production, and high-end gaming, wherever physically accurate lighting matters more than raw frame rate. In Unity, developers can enable ray-traced effects selectively in HDRP, including reflections, ambient occlusion, and global illumination, rather than switching an entire scene over at once. Unity's Reality vs. Illusion demo, built with NVIDIA and BMW, rendered a CG version of the 2019 BMW 8 Series Coupe that's visually indistinguishable from the real car.

What are the benefits of ray tracing?

  • Physically accurate lighting: Reflections, shadows, and global illumination behave the way light actually does, not an approximation of it.
  • Fewer manual workarounds: Artists spend less time faking effects like reflections and soft shadows that ray tracing produces naturally.
  • Dynamic lighting changes for free: Since lighting is calculated per frame rather than pre-baked, scenes respond correctly when lights, time of day, or objects change.

What are the challenges of ray tracing?

  • Real hardware requirements: Full ray tracing acceleration needs a GPU with dedicated ray tracing hardware, not every player's system qualifies.
  • Measurable performance cost: Enabling ray tracing typically lowers frame rate, which is why most real-time applications apply it selectively rather than across an entire scene.
  • More setup than rasterization: Configuring ray tracing correctly means additional project setup, like enabling the right graphics API and render pipeline settings.

Frequently asked questions (FAQ)

Does ray tracing reduce frame rate?

Yes, generally. Ray tracing is computationally intensive, and enabling it typically lowers frame rate compared to rasterization alone. Most real-time applications manage this by applying ray tracing only to specific effects, like reflections, rather than the entire scene.

Do you need special hardware to use ray tracing?

For real-time ray tracing, yes, you need a GPU with dedicated ray tracing hardware, such as an NVIDIA RTX or AMD RDNA2-based card. Ray tracing can still be used without this hardware for offline, non-real-time rendering, just much more slowly.

Related terms

Anti-Aliasing

Anti-aliasing is a rendering technique that smooths jagged edges in digital graphics.

3D Rendering

3D Rendering is the process of generating 2D images from 3D scene data using lighting algorithms, texture mapping, and material properties while balancing visual fidelity against performance requirements for real-time applications.

Real-time 3D

Real-time 3D technology renders complex three-dimensional environments instantly as changes occur, allowing immediate visualization of design modifications and enabling interactive experiences across industries from gaming to architectural visualization and digital twins.