The Path Tracer is a progressive, hardware-accelerated rendering mode that mitigates the disadvantages of real-time features with physically correct and compromise-free global illumination, reflection and refraction of materials, and more. It shares the ray tracing architecture built into Unreal Engine, with minimal to no additional setup required to achieve clean, photoreal renders.
The Path Tracer uses the same ray-tracing architecture as other ray-tracing features, such as Real-Time Ray Tracing and GPU Lightmass, making it ideal for ground truth comparisons and production renders. The Path Tracer only uses geometry and material present in the scene to render its unbiased result, and does not share the same ray-tracing code that has been developed to work well for real-time rendering.
Benefits of the Path Tracer
The Path Tracer provides the following benefits when compared to other rendering modes:
The ability to generate high-quality photorealistic renders with physically accurate results.
Minimal or no additional setup required to achieve comparable results to other offline renderers.
Reduces the feature gap of comparable real time features. For example, materials seen in reflections and refractions are rendered without limitations, such as having global illumination and path-traced shadows present.
Full integration with Sequencer and Movie Render Queue to support Film / TV quality render outputs.
Path-Traced Scene Examples
The following scenes are examples of the high-quality renders achieved using the Path Tracer.
Enabling the Path Tracer in Your Project
The Path Tracer requires Hardware Ray Tracing to be enabled for the project. The following system requirements must be met and these settings must be enabled.
System Requirements:
Operating System: Windows 10 1809 or later
GPU: NVIDIA RTX and DXR driver-enabled GTX series graphics cards
Project Settings:
Platforms > Windows > Targeted RHIs > Default RHI: DirectX 12
Engine > Rendering > Hardware Ray Tracing: Enable Path Tracing
Engine > Rendering > Hardware Ray Tracing: Enable Support Hardware Ray Tracing
Engine > Rendering > Hardware Ray Tracing: Enable Path Tracing
Unreal Engine 5 introduced settings that control the creation of path tracer specific shader permutations for materials. Projects which do not plan to use the path tracer at all can disable this setting to reduce shader compilation time.
Engine > Rendering > Optimizations: Enable Support Compute Skin Cache
When Support Hardware Ray Tracing is enabled for the project, a pop-up window asks you to enable Support Compute Skin Cache if it is not already enabled. This is required to support hardware ray tracing and path tracing features.
Restart the engine for changes to take effect.
Limitations of the Path Tracer
The following are some of the current limitations of path tracing in Unreal Engine.
Bright Materials slow down interior renders
Materials which have an albedo value close to 1.0, such as a bright white color, cause rendering of frames to take longer than needed because the path Tracer needs to simulate the path of lights with many bounces. Interior scenes are especially susceptible to this because light rays can take longer to escape the environment before being terminated. The Path Tracer employs the Russian Roulette technique to terminate rays that aren't likely to contribute to the scene sooner. Rays that continuously bounce through the scene are less likely to happen because they are terminated by the Russian Roulette technique when possible. When a material's albedo uses a value close to 1.0, termination of the ray path is less likely to happen, and contributes to longer render times for the frame.
Materials that reflect all incoming light are rare in the real world, and these tend to have a washed out appearance to their surface. For this reason, it is recommended that you keep the Base Color below 0.8 for all diffuse materials.
Dynamic Scene Elements
The Path Tracer works by having the renderer accumulate samples over time. This is ideal for static scenes and less so for dynamic scenes that include elements such as moving lights, animated skinned meshes, and visual effects. These types of elements do not invalidate path tracing in the editor and appear as blurred, or streaking artifacts in the frame. This only appears when working in the editor and is remedied by using the Movie Render Queue to render out final elements.
Path Tracing Material Quality Switch Nodes
Optimizing materials for path tracing features by reducing their complexity using the PathTracingQualitySwitch node reduces complexity or workarounds used in standard materials. Since runtime is not a concern, compromises to the material are not needed. Using these nodes helps provide a compromise-free result without duplicating the material.
Ray Tracing Material Quality Switch Nodes
Optimizing material for ray tracing features by reducing their complexity uisng the Ray Tracing Quality Switch node helps reduce their costs at runtime. This allows Unreal Engine's ray tracing features to use a simpler material compared to the deferred renderer. Since the Path Tracer is intended for high quality output, it uses the Normal port of these Switch nodes, despite being based on ray tracing. To control the behavior of materials specifically for the Path Tracer, use the PathTracingQualitySwitch node instead.
HDRIBackdrop is not compatible with the Path Tracer
The current implementation of the HDRIBackdrop component leads to double-counted illumination in the Path Tracer and disables importance sampling of the HDRI lighting. It is recommended to use a Sky Light with a specified texture and setting the path tracer console variable
r.PathTracing.VisibleLights 2
to make the backdrop appear.
This does not provide a shadow-catching ground plane.
For additional information and notes on specific features, see the Supported Features section of this page.
Using the Path Tracer in the Level Editor
Enable the Path Tracer view in the Level Viewport by using the View Modes dropdown menu to select Path Tracing.
When enabled, the renderer progressively accumulates samples from the current view by continuously adding samples while the camera is not moving. When the target sample count is reached, the frame will be denoised (if denoising is enabled in the Post Process Setting) to remove any remaining noise present in the render.
In most cases, when the scene changes the samples are invalidated and the process starts again. Moving the camera, changing views, updating or changing materials on an object, and moving or adding objects to the scene will all result in the scene's samples being invalidated.
The Path Tracer can be used interactively and will quickly start to display pixels with shaded color as samples accumulate. The amount of time it takes to render largely depends on the complexity of the scene and the materials being sampled. Outdoor scenes tend to render more quickly as rays can escape with fewer and faster bounces. Interior scenes, especially those with materials with albedos close to 1.0, cause light paths to be longer and will therefore result in a longer render time.
Post Process Volume Path Tracer Settings
Placed Post Process Volumes in the Level provide configurable properties for the Path Tracer. These include settings for the maximum number of light bounces, samples per pixel, anti-aliasing quality (or Filter Width), and more.
Settings for the Path Tracer can be found in the Post Process Volume Details panel under the PathTracing category.
Property |
Description |
---|---|
Max. Bounces |
Sets the maximum possible number of light bounces rays should travel before being terminated. |
Samples Per Pixel |
Sets the number of samples used per pixel for convergence. A higher number of samples reduces noise of the rendered image. |
Filter Width |
Sets anti-aliasing filter width to improve output quality. Lower values yield sharper (more aliased) results, while larger values yield softer (blurier) results. |
Emissive Materials |
Enables bounce lighting for emissive materials. Enabling this property prevents double-counting illumination of surfaces that are also represented by actual light sources, and noise from small emitters. For example, having an emissive material representing a small light bulb while also using a point or spot light source to illuminate the area would be double-counted in this case. |
Max Path Exposure |
Sets the maximum exposure allowed for path tracing in order to reduce firefly artifacts from occurring. Adjusting the exposure to a higher value than the scene's exposure helps mitigate these artifacts. (See Additional Information section of this page for more details and an example of this type of artifact). |
Denoiser |
This toggle uses the currently loaded denoiser plugin on the last sample to remove noise from the rendered output. By default, Intel's Open Image Denoiser plugin is used by the Unreal Engine. This toggle has no effect on the rendered output if the denoiser plugin is not enabled. |
Path-traced Renders Using Movie Render Queue
This section goes into details about using the Movie Render Queue to generate a path-traced rendered output. For general usage and workflow information, see Movie Render Queue before proceeding.
The Movie Render Queue (or MRQ) is useful for production pipelines when producing high-quality rendered outputs. When combined with the Path Tracer, it allows for substantially higher quality renders than could be achieved otherwise.
The Path Tracer module enables the Path Tracer to be used to output rendered frames and it provides some settings specific to its rendering path.
Post Process Volumes placed in the Level also control specific path tracing functionality, such as the maximum number of ray bounces, support for emissive materials, and exposure.
MRQ also contains other settings modules that provide additional controls and options for achieving higher-quality renders.
The High Resolution module provides settings to render frames as separate tiles that can be combined to render higher single frame resolutions than would otherwise be possible. Individual tiles can use up to the largest resolution supported by your graphics card (for example, 7680x4320 for RTX 3080 cards).
The Anti-aliasing module provides specific settings to adjust the sample counts per pixel and for better motion blur quality. This module provides warm-up times that can be required for level-loading and visual effects to render the scene accurately.
Temporal Sample Count interpolates several rendered frames at slightly offset instances in time, improving motion blur quality. This accumulation of samples happens after denoising occurs, helping stabilize residual artifacts from individual spatial passes.
Spatial Sample Count sets the number of samples per pixel to use per frame. Increasing the samples per pixel, decreases noise present in each render pass while increasing the time needed to render each frame. The Post Process Volume samples per pixel setting has no effect over this setting for the MRQ output.
The total number of samples taken per pixel is the product of the spatial and temporal sample counts. Spreading the samples across both spatial and temporal can produce better results in some cases. For example, if you want to use 16 samples per pixel, you could apply 4 samples to spatial and 4 to temporal, or 16 to spatial and 1 to temporal.
The Console Variables module enables you to add any console variables that are relevant to your rendered frames. This includes overrides for quality, or toggling of some settings that would be relevant to the Path Tracer.
The Output module provides settings to configure the output directory, file name, image resolution, and the start / end frames you want to render.
Additional Information
The Path Tracing mode works differently than some other rendering methods within Unreal Engine. This means that something that works well for real-time rendering may not work best for path-traced rendering. The following sections describe some of these inconsistencies and common issues as well as the steps you can take to improve your results with the Path Tracer.
Reducing Firefly Artifacts
The Path Tracer simulates light by randomly tracing rays according to material properties. When bright areas of the scene have a low probability of being discovered, the resulting samples can become excessively bright, creating specs of light (or fireflies) that appear and disappear within the frame. Path tracing attempts to minimize the most common sources of these effects, but they can still occur in some scenarios.
When the path-traced result is combined with bloom post processing passes, the resulting pixels can be particularly noticeable because of how they appear and disappear, or become brighter and dimmer.
The Post Process Setting Max Exposure Path controls the maximum exposure used in the rendered path-traced scene. Adjusting the exposure to be a few steps higher than the current scene exposure, set by the Post Process Max EV100 (found under the Lens > Exposure section), will reduce the chance of fireflies occurring.
Denoising
Even with high sample counts, the path tracer will always have a bit of residual noise in the rendered frame. The denoising option in the Post Processing Volume settings makes use of Intel's Open Image Denoise library to remove noise from the last sample.
The denoiser runs on the CPU and is not currently designed for interactive denoising, but rather to help improve the quality of long-running frames. It does not currently guarantee temporal consistency, and relatively high samples per pixel are required for stable output. Temporal stability can also be improved by increasing the Temporal Sample Count in the Anti-aliasing settings module when using Movie Render Queue.
Skylighting with the Path Tracer
Skylighting is handled in two ways: using a traditional skybox with an applied sky material, or using the Real Time Capture mode of the Sky Light to capture the sky, atmosphere, and clouds in the scene.
|
|
---|---|
Skybox Mesh |
Sky Light Real Time Capture |
Using a skybox to represent the sky requires a couple of things to be set up on the mesh and in the material for it to work well with the Path Tracer. First, the sky material must have the flag Is Sky enabled in the Material's Details panel settings. This ensures that the illumination of the skybox material won't be counted twice when the Sky Light is present in the scene. It also potentially reduces the amount of noise that can occur if the skybox were to in fact be counted twice.
In the Level, select the skybox Actor and use the Details panel to disable Cast Shadows to prevent the mesh from occluding contributions from the Sky Light and Directional Light in the scene.
Alternatively, lighting contributions from the Sky Atmosphere and Volumetric Clouds systems can be captured by enabling Real Time Capture mode on the Sky Light. Because of this limitation for capturing skyboxes, Sky Atmosphere, and Volumetric Clouds for skylighting representation, their resolutions are dependent on the Sky Light Cubemap Resolution.
|
|
---|---|
Sky Light Cubemap Resolution: 128 (Default) |
Sky Light Cubemap Resolution: 512 |
Direct Visibility of Light Sources
Non-punctual light sources — such as Point Lights with a source radius, Rect Lights, and Sky Lights — are not visible to direct camera rays by default. The exception to this is Sky Lights with Real Time Capture enabled.
Skylighting paired with skybox geometry and static, or specified, cubemaps are not typically seen by camera rays. This can be modified by setting the console variable r.PathTracing.VisibleLights 1
.
All light sources are visible in reflections and refractions regardless of if the visible lights console variable is enabled. This ensures that they are seen by all possible ray paths. However, in some cases, this might cause unexpected behavior. For example, a Rect Light placed directly behind a glass window will be visible and will block the view through the window, which is only the case for true refraction, when the index of refraction is not equal to 1.
Glass Rendering with the Path Tracer
There are two methods of rendering glass with specified thickness with the Path Tracer: by using a few values which provide a physically accurate look based on the physical properties of the surface, or by using additional properties which allow for more control over art direction but are less physically correct. Both of these methods are acceptable and valid for use with the Path Tracer to achieve high-quality results with glass-like materials.
Achieving physically accurate results only requires a few values and parameters to be set in the material, like this example below:
In situations where more control is needed over the art direction, adjusting the Base Color can tint the glass reflection (but not the shadows), and a Fresnel plugged into the Opacity input allows the reflection falloff to be controlled more closely.
Approximate Caustics
The Path Tracer uses approximate caustic paths to help reduce noise, especially in cases where a glass or metal surface has lower roughness values. For these types of materials, the reflective caustics can produce various patterns and can take up an impractical amount of time, or samples, to converge for a noise-free image.
For example, these images were taken sequentially during the rendering and sample accumulation process with the final image being the finished and denoised result.
Because caustics generally take a long time to converge to a noise-free result, the Path Tracer reduces image noise by approximating the caustics that would be present in the image using the console command r.PathTracing.ApproximateCaustics 1
. This variable is enabled by default.
Another element to consider is the difference between refractive caustics and approximate casustics. By using the denoiser, it is possible to preview how the caustics would appear given enough time to converge, whereas the approximate caustics gives a production-ready image in much shorter time.
Thin Translucency Shading Model
The Thin Translucency shading model is useful for achieving physically accurate results with appropriately colored translucent shadowing for thick glass with approximate caustics.
One thing to be aware of is that each interface is treated as a unique pane of glass, which means that refraction is not calculated by the shader and the object will look more like a bubble than solid geometry.
Standard Glass Material |
Thin Translucent Glass Material |
Click image for full size view. |
Click image for full size view. |
Color Absorption
Materials with their Blend Mode set to Translucent and a non-unit Refraction parameter are rendered as solid glass. You can control the color of the transmission through the glass (also known as "Beer's law"), use the Absorption Medium material output node in the Material Graph. This feature is only available for the Path Tracer as it requires tracking the state of the ray color through multiple bounces.
This is an example of the material setup used to control absorption in the Path Tracer.
When setting a RGB color, values close to 1 will not demonstrate absorption.
The example material above use Transmittance Color to control the amount of absorption that is happening. The specified color is normalized to be reached after a distance of 100 units. To change this distance, use the following formula Transmittance Color = Color^(100/Distance)
.
|
|
|
|
---|---|---|---|
Absorption: 0x |
Absorption: 1x |
Absorption: 10x |
Absorption: 100x |
Energy Conservation
The Unreal Engine 5 implementation of Energy Conservation is used to reduce the energy loss in the specular lob of metals and glass materials.
You can turn on Energy Conservation from the Project Settings under the Engine > Rendering > Materials section.
To preserve backwards compatibility this feature is currently disabled by default. In a future release of the engine, this feature is expected to be enabled by default.
Rough Light Transmission and Reflections
The Path Tracer is unique in that it allows for the rendering of rough transmission in addition to rough reflection — and in the case of the Path Tracer, these shader parameters are coupled together.
In the examples below, the roughness value of the glass material varies to demonstrate the approximate caustics, roughness of the reflection, and the effect it has on the translucent shadow being cast.
Useful Console Variables
The following are some useful console variables to have enabled when using the Path Tracer.
Console Variable |
Description |
---|---|
|
Makes all lights visible to camera rays. This is disabled by default to match the raster-based modes of the engine, but it can be useful to understand how lights are modeled and to spot cases where lights are overlapping. |
|
This adds a small progress bar to the view that displays progress toward the configured samples per pixel. The progress bar will automatically be hidden when accumulation is completed. It does not affect renders with Movie Render Queue and is safe to have on. |
|
This option can be used to quickly toggle the denoiser on and off (assuming the current sample accumulation is complete). Unlike the Post Process Volume setting, changing this will not cause accumulation to restart and can be useful for quickly comparing the rendered frame with and without denoising enabled. |
Frequently Asked Questions
Capturing a Converged Path-Traced Image using HighResShot
Use the console variable r.HighResshotDelay
equal to the currently active Samples Per Pixel in your scene. A good way to validate that the correct output is being captured is to leave r.PathTracing.ProgressDisplay
set to 1. If the progress bar is not present in the captured image, sample accumulation is complete.
Enabling the Path Tracer at Runtime
The Path Tracer can be used at runtime (on supported platforms). Use the console command show PathTracing
to toggle the Path Tracer on and off in a game viewport. In a Blueprint, you may use Execute Console Command
to perform this task.
Avoiding Timeout Delays on Windows for "D3D Device Removed Crashes"
Windows tries to maintain system responsivenss by limiting the amount of time a GPU kernal can take. For a resource intensive process, such as brute force path tracing, this limit can be hit more frequently, particularly on lower end GPUs or when light simulation becomes too complex to finish in a reasonable time.
The engine exposes a few console variables to control the amount of work performed at once, though that these variables can reduce overall performance if set incorrectly. It's recommended to keep watch on overall performance with the stat gpu
command.
r.PathTracing.DispatchSize
controls the maximum width and height in pixels for the path-traced render. if this value is lower than your viewport or image resolution, the render may take place in several steps, which increases the amount of times Windows can verify that the GPU is still responsive. The default is 2048.r.PathTracing.FlushDispatch
controls how frequently to flush the command list during the path tracing process. Setting this to 1 gives Windows more chances to verify the GPU is still responsive. By default, this is set to 2.
In extreme cases, it may be difficult to maintain good performance while avoiding crashes. In such cases, it is possible to change the Windows Timeout limit itself. See How to Fix a GPU Driver Crash.
For scenes containing hair, it is possible for acceleration structure (BLAS) timeouts to occur. In this case, try lowering the value of r.HairStrands.RaytracingProceduralSplits
to 4.
Instances Disappearing in the Path-Traced View
The default culling implementiong for Hardware Ray Tracing can be overly aggressive in the context of path tracing, since ray tracing is also used for camera visibility. If instances appear to be missing when switching to the Path Tracer view, try setting r.RayTracing.Geometry.InstancedStaticMeshes.Culling
to 0.
Using Path Tracer with Nanite-Enabled Meshes
The Path Tracer does not currently support Nanite-enabled meshes but will use its Fallback Mesh for representation in the path-traced scene. The Fallback Mesh uses a percentage of the source mesh's triangles for representation. This can lead to Nanite-enabled meshes having lower detail in the scene.
To increase the detail of a Nanite-enabled, you'll need to adjust the Nanite settings Fallback Triangle Percent and Fallback Relative Error in the Static Mesh Editor.
For more information on configuring these settings, see the "Fallback Mesh" section of the Nanite documentation.
Supported Features of the Path Tracer
The limitations of the Path Tracer are either limitations of the current implementation or features that aren't planned for support. This list of features intends to give you an idea of what is currently supported with this current release. It is not a comprehensive list of all supported features / properties of the engine.
The Path Tracer shares the same code used with Real-Time Ray Tracing features of Unreal Engine. In general, if a feature is supported by real-time ray tracing then it should be supported by the Path Tracer.
Feature Name |
Supported? |
Additional Notes |
||
---|---|---|---|---|
Geometry Types |
||||
Nanite |
No |
The Fallback Mesh is used for Nanite-enabled meshes. Lower Fallback Relative Error to use more of the source mesh's triangles. |
||
Skinned Meshes |
Yes |
Animations do not invalidate the path tracer, which can cause blurring, or streaking, to be visible in the viewport. Movie Render Queue should be used to output final images. |
||
World Position Offset-driven Animation |
Yes |
Evaluate World Position Offset should be enabled on individual scene Actors. They do not invalidate the Path Tracer, which can cause blurring, or streaking, to be visible in the viewport. Movie Render Queue should be used to output final images. |
||
Hair Strands |
Yes |
Hair Strand support is still considered experimental as it can require many resources to build efficient acceleration structures. The console variable |
||
Landscape |
Yes |
|||
Spline Meshes |
No |
|||
Instanced Static Mesh |
Yes |
|||
Hierarchical Instanced Static Mesh |
Yes |
|||
Visual Effects |
||||
Niagara Particle Systems |
Yes |
Particle systems do not invalidate the Path Tracer, causing blur / streaking to be visible in the viewport. Movie Render Queue should be used to output final images. |
||
Light Types |
||||
Directional Light |
Yes |
|||
Sky Light |
Yes |
|
||
Point Light |
Yes |
|||
Spot Light |
Yes |
|||
Rect Light |
Yes |
|||
Lighting Features/Properties |
||||
Emissive Materials |
Yes |
Emissive parts that are small can introduce a lot of noise to the rendered scene. They can also cause double-counted lighting if the emissive parts have a light associated with them. Use the Emissive Materials checkbox in the Post Process Volume settings to disable them, or use the console variable |
||
Sky Atmosphere |
Partially |
Requires a Sky Light in the scene which has Real Time Capture enabled. |
||
Volumetric Clouds |
Partially |
Requires a Sky Light in the scene which has Real Time Capture enabled. |
||
Exponential Height Fog |
No |
Currently planned for Unreal Engine 5.1. |
||
Volumetric Fog |
No |
Currently planned for Unreal Engine 5.1. |
||
IES Profiles |
Yes |
|||
Light Functions |
No |
|||
Post Processing |
||||
Depth of Field |
Yes |
By default, the Path Tracer leverages the engine's post-processed depth of field but inherits the inherent limitations of this approach when it comes to translucent materials. As an alternative, enable a reference quality mode in the Post Process Volume which simulates depth of field directly during the path tracing process instead. |
||
Motion Blur |
Partially |
Only supported with rendered frames from Movie Render Queue. |
||
Material Shading Models |
||||
Unlit |
Yes |
|||
Default Lit |
Yes |
|||
Subsurface |
Yes |
|||
Preintegrated Skin |
Yes |
Renders identically to the subsurface shading model. |
||
Clear Coat |
Yes |
|||
Subsurface Profile |
Yes |
Requires a subsurface profile with Burley subsurface scattering enabled. |
||
Two Sided Foliage |
Yes |
|||
Hair |
Yes |
Support for this shading model is still considered experimental and has not yet been calibrated against the behavior of the Lit Shading Model. |
||
Cloth |
Yes |
|||
Eye |
Yes |
|||
SingleLayerWater |
No |
|||
Thin Translucent |
Yes |
|||
From Material Expression |
Yes |
|||
Material Features |
||||
Colored Shadows |
Yes |
Can be achieved with the Thin Translucent or solid glass. See the Glass Rendering with the Path Tracer and Color Absorption sections of this page. |
||
Translucent Shadows |
Yes |
|||
Refraction |
Yes |
|||
Decals |
No |
|||
Anisotropy |
Yes |
|||
System Support |
||||
Multiple GPU |
No |
|||
Sequencer Movie Render Queue |
Yes |
|||
Orthographic Camera |
Partially |
Does not currently support output through Movie Render Queue. |