Ray tracing

Hardware ray-traced reflections, ambient occlusion, sun shadows and Global Illumination gather, the ray-tracing scene, and the path-traced reference renderer.

Last updated Nov 4, 2026Edit this pageVersion 1.0.0

Mowo uses hardware ray tracing to improve four real-time effects: reflections, ambient occlusion, sun shadows and the Global Illumination gather. MegaLights also traces its shadow rays against the same scene. Every one is optional: when the device has no ray query, or the ray-tracing scene is not ready, each falls back to its raster or screen-space version for that frame. A progressive path tracer uses the same scene as a reference.

Ray tracing is off for a new project, like Unreal's Support Hardware Ray Tracing. Turn it on in Project Settings > Rendering > Features > Ray Tracing (r.RayTracing.EnableForProject 1). While it is off no tier and no r.* cvar below enables a ray-traced feature, no ray-tracing scene is built, no ray-tracing pipeline compiles, the path tracer view mode stays dark and DLSS Ray Reconstruction does not run. The LiDAR scanner is gameplay, not rendering, and still builds the scene it traces.

Hardware requirements

Most ray tracing in Mowo is inline ray query: a pixel or compute shader traces rays itself, with no ray-tracing pipeline. Ray-traced sun shadows, and reflections when you ask for it, use a real ray-tracing pipeline with per-material hit shaders where the backend has one.

BackendRay queryRay-tracing pipelines
Direct3D 12Yes (DXR)Yes
VulkanYes (VK_KHR_ray_query)Yes (VK_KHR_ray_tracing_pipeline)
MetalYes (intersection_query)No
Direct3D 11NoNo

FRHIApiCeiling::SupportsRayTracing and SupportsRayTracingPipeline give the API ceiling; RendererCapabilities::SupportsRayQuery and SupportsRayTracingPipeline give the device answer. Check both: a Vulkan driver can expose ray query without the pipeline extension.

Which features, which tier

With Ray Tracing on in Project Settings:

FeaturecvarReplacesOn by default at
Ray-traced reflectionsr.RTReflectionsThe world leg of screen-space reflectionsEpic, Cinematic
Ray-traced AOr.RTAOGTAOEpic, Cinematic
Hardware ray-traced GI gatherr.GI.HWRTGatherThe distance-field trace of the screen-probe gatherEpic, Cinematic
Ray-traced sun shadowsr.RTShadowsThe cascade and virtual-map lookup in lightingCinematic
MegaLights shadow raysr.MegaLightsA screen-space depth marchEpic, Cinematic, when a ray scene exists

Each cvar takes -1 for the tier value and 0 or 1 to force the feature.

Can this machine run it?

FRayTracingCapability::Query(feature) answers per feature, with the reason when the answer is no:

C++
#include <RHI/RayTracingCapability.h>

const FRayTracingAvailability rt = FRayTracingCapability::Query(ERayTracingFeature::SunShadows);
if (!rt.Available) {
    ShowGreyed(rt.Reason);   // "Ray-Traced Sun Shadows is unavailable: this GPU or its driver does not report ray queries"
}

The features are Reflections, AmbientOcclusion, SunShadows and GiGather, and FRayTracingCapability::CVarName gives the switch each one reads (r.RTReflections, r.RTAO, r.RTShadows, r.GI.HWRTGather). Block names the first thing that rules the feature out, in the order a player can act on it: Backend (switch graphics API), DriverOrGpu (no ray query on this device), then ProjectSwitch (the game did not enable ray tracing in Project Settings). The player settings screen uses the same answers, so a missing option and a greyed one say the same thing.

Tip

You do not need Epic to try ray tracing. With the project switch on, on a High-tier machine with a capable GPU, set r.RTReflections 1 or r.RTAO 1. Each one builds the ray-tracing scene it needs.

The ray-tracing scene

SceneRenderer builds acceleration structures at the start of each frame whenever a consumer wants them: r.RTScene, or any of the features above.

  • Bottom-level cache. One structure per mesh, built once and shared across instances and frames. New builds are limited per frame (r.RTScene.BlasBudget, default 8), so a large scene streams in over a few frames instead of hitching. Built structures are compacted (r.RT.BLASCompaction).
  • Top-level structure. One per frame in flight. When only transforms change, it is refitted instead of rebuilt.
  • Terrain joins as tiles of real triangles generated from the height texture (r.RT.Terrain, default 1).
  • Foliage clumps near the camera join, up to r.RT.Foliage.Distance (default 40) and r.RT.Foliage.MaxInstances (r.RT.Foliage, default 1).
  • Translucent geometry joins, visible only to reflection rays and, with r.RT.TranslucentShadows, to shadow rays, where it occludes by its opacity (r.RT.Translucent, default 1).

Alpha-masked geometry is resolved per hit: where a pass can reach the material, it runs the material's own alpha test at the hit; otherwise it accepts the hit with probability equal to the mesh's average coverage.

Ray-traced reflections

Ray-traced reflections share the screen-space reflections' inputs, output and denoiser. With r.Reflections.Continuation (default 1) each pixel shoots one ray: it marches the depth buffer first, and only rays that leave the screen or fail continue into the ray-tracing scene from where they stopped. Objects behind the camera and outside the screen reflect correctly.

cvarDefaultMeaning
r.RTReflections.RoughnessCutofftierRougher surfaces fall back to distance-field or environment reflections
r.RTReflections.HitLighting1How a hit is shaded: 0 flat per-instance data, 1 the Global Illumination radiance cache with a near-hit blend
r.RTReflections.Pipeline0Trace through a ray-tracing pipeline with per-material hit shaders instead of inline ray query. D3D12 and Vulkan only.
r.RTReflections.SecondBounce1With the pipeline, a smooth metal hit traces one more reflection ray

Ray-traced ambient occlusion

Ray-traced AO runs in the AO slot in place of GTAO and writes the same target. It casts r.RTAO.Rays rays per pixel (2 at Epic, 3 at Cinematic) and accumulates them over about 25 frames on a still pixel (r.RTAO.TemporalAlpha, default 0.96). It falls back to GTAO when the ray-tracing scene is unavailable.

GTAO and ray-traced AO read the shared AO radius differently: GTAO marches it in screen space, ray-traced AO uses it as a world-space ray length. So ray-traced AO multiplies it (r.RTAO.RadiusScale, default 4.2, which turns the default 0.5 radius into a 2.1 m ray) and applies a gain (r.RTAO.Calibration, default 1.32). With both defaults, the scene keeps the same average darkening when a tier change swaps GTAO for ray-traced AO. r.RTAO.Radius sets the ray length directly and overrides the product. The rays, radius scale, calibration and history are also in Project Settings > Engine > Global Illumination, under Ambient Occlusion.

Note

Leave r.RTAO.RadiusScale at its default unless you are matching a different look. A longer ray adds occlusion, but with two or three rays a pixel it also adds noise; r.RTAO.Calibration changes the average darkening without that cost. The default was 12 in earlier versions; a project that sets the scale in its own config keeps its value, and only 4.2 is fitted to GTAO.

Sun shadows and the GI gather

These two are covered on their own pages:

Turn on ray tracing for your project

  1. Turn on the project switch

    Project Settings > Rendering > Features > Ray Tracing. It is saved in Config/Engine.ini; a project can also set r.RayTracing.EnableForProject=1 under [ConsoleVariables] in Config/DefaultEngine.ini. Global Illumination's hardware gather also needs Global Illumination on.

  2. Use a backend with ray query

    D3D12 or Vulkan on a capable GPU, or Metal. D3D11 has no ray tracing. See Backends.

  3. Choose Epic or Cinematic, or enable features one by one

    Epic turns on ray-traced reflections, AO and the GI gather. Cinematic adds ray-traced sun shadows. On other tiers, set the individual cvars.

  4. Use the settings pages

    Project Settings > Rendering has Reflection Method (screen space or ray traced). Players have Reflection Method, Ray-Traced Scene and Ray-Traced Sun Shadows rows in the Graphics settings.

  5. Check that it is working

    Switch the viewport to the Reflections buffer view (r.ViewMode 15). Objects outside the screen should now appear in mirrors. If nothing changed, the device has no ray query and the fallback is running.

Two captures of the same polished floor in front of a column at the Epic tier, left with r.RTReflections 0 showing the column's reflection cut off at the screen edge, right with r.RTReflections 1 showing the full column reflected including the part outside the view
Screen-space reflections lose what is off screen; ray-traced reflections do not.

Path tracer

The path tracer is a progressive, physically based reference renderer. It accumulates samples across frames until the image converges, and it is what the real-time Global Illumination, reflections and shadows are checked against. It traces the same scene as the real-time features with a diffuse plus GGX specular BRDF, samples the material's albedo, normal and metallic-roughness maps at each hit (r.PathTracer.Textures), samples the sun and local lights directly, and reads the sky cubemap on a miss.

Use it

  1. Open the view mode

    In the viewport's view-mode menu, choose Path Tracing under Reference. The viewport shows the sample count as it accumulates. Leaving the view mode returns to real time; the mode costs nothing when it is not selected.

  2. Hold the camera still

    Accumulation restarts when the camera, the lights, the ray-tracing scene or a setting changes. Leave the view still until the noise clears; the denoiser keeps a fresh accumulation readable.

  3. Tune it

    Use Project Settings > Engine > Path Tracer or the cvars below.

Mowo Editor viewport in the Path Tracing view mode on an interior scene, with the sample-count label in the viewport corner reading several hundred samples per pixel and a nearly noise-free image
The Path Tracing view mode with its sample count.
cvarDefaultMeaning
r.PathTracer.Enable0Force the tracer on in every view, the running game included, for offline capture. Session only: no config file applies it.
r.PathTracer.SamplesPerFrame1Samples per pixel per frame, 1 to 16
r.PathTracer.MaxSamples4096Samples per pixel after which the converged image is held; 0 never stops
r.PathTracer.MaxBounces8Bounces per path, 1 to 32
r.PathTracer.Denoise1Edge-aware denoiser over the accumulation; 0 shows the raw reference
r.PathTracer.FireflyClamp256Per-sample brightness limit; 0 is unbounded. Raise it for very bright skies.
r.PathTracer.FurnaceSky0Energy check: replaces the sky with a uniform one of this radiance and drops the other lights

For a reference frame without the editor, render with a static camera and write a screenshot after N frames:

PowerShell
MowoGame.exe --project=MyGame.mproject --scene=Content/Maps/MyMap.mmap --screenshot=out.png --screenshot-frame=96 --cvar=r.PathTracer.Enable=1

This needs a dev or debug build, because a release build drops --cvar= and --scene.

Path tracer limits

  • It needs ray query and 64-bit shader integers. Metal reports no 64-bit shader integers today, so the path tracer does not run there.
  • Diffuse and GGX only: clear coat, anisotropy, subsurface and area-light shapes are not sampled.
  • Glass and water are not traced. Translucent surfaces, particles and world widgets are composited on top with raster shading.
  • The environment is the sky cubemap. A scene lit only by a procedural sky with no cubemap reads black on a miss.
  • It is a reference mode and is not meant to run at interactive frame rates.

API reference

Engine sources

This page describes behavior implemented in these files of the engine repository, checked against commit 47c78cd0a.

  • Engine/Source/Runtime/RHI/Public/RHI/RendererAPI.h
  • Engine/Source/Runtime/RHI/Public/RHI/RendererTypes.h
  • Engine/Source/Runtime/RHI/Public/RHI/AccelerationStructure.h
  • Engine/Source/Runtime/RHI/Public/RHI/RayTracingPipeline.h
  • Engine/Source/Runtime/RHI/Public/RHI/BlasCompaction.h
  • Engine/Source/Runtime/RHI/Public/RHI/ProjectRenderFeatures.h
  • Engine/Source/Runtime/RHI/Public/RHI/RayTracingCapability.h

Page feedback

Was this page helpful?