Optimizing Ray Traced Reflections - UE4 Materials 101 - Episode 44

Опубликовано: 27 Октябрь 2024
на канале: Ben Cloward
10,588
327

In this video, we go over 5 methods for improving the performance of ray traced reflections in Unreal Engine. These techniques take the frame rate in our test scene from around 20 fps at the start to over 60 fps (and even above 70 fps!) at the end. They're well worth using if your game is using ray traced reflections.

Here are the 5 techniques:
1. Use the RayTracing switch in the materials to simplify the materials when rendered into reflections
2. r.RayTracing.Reflections.TestPathRoughness 1
This console command acccumulates the roughness for each ray traced bounce. Since we have a low Max Roughness cut-off, this can allow the ray tracing to "early-out" if roughness goes higher than the Max Roughness cut-off.
3. r.RayTracing.Reflections.MaxRayDistance 500
This console command limits the distance of reflection rays - so we reduce the number of potential objects that need to be tested to see if the reflection ray hits them,
4. r.RayTracing.Reflections.ScreenPercentage 50
This console command renders the reflections at half resolution, so the number of rays is reduced significantly. However, it does introduce some jitter into the reflections, so you may consider skipping this one is the jitter isn't acceptable.
5. r.RayTracing.Reflections.Hybrid 1
This console command turns on screen space reflections when the ray hits something that is on-screen and only does real ray tracing when the ray goes off-screen. Since SSR is cheaper than ray tracing, this saves some perfomance by only doing ray tracing in places where SSR doesn't work.

r.RayTracing.Reflections.ReflectionCaptures 1
For our last technique, this command turns on cube map reflections and uses them in locations where ray tracing fails - such as were the bounce limit or max ray distance is reached.

The scene we're using in this series:
https://www.unrealengine.com/marketpl...

Other videos in this series:
   • UE4 Ray Tracing  

------------------------------

Learn more!!
   • How to use Real Time Raytracing in Un...  
   • Exclusive Unreal Engine video - Real-...  
   • How to get the most out of ray tracin...  

Resources on the web:
https://developer.nvidia.com/blog/ray...
https://developer.nvidia.com/blog/int...

Shader Book Recommendations
https://www.bencloward.com/resources_...
------------------------------

Learn to write shaders in HLSL:
   • HLSL Shader Creation 1 - HLSL Shader ...  
   • HLSL Shader Creation 2 - Light and Sh...  
   • HLSL Shader Creation 3: Surface Shadi...  

------------------------------

Theme Music
Peace in the Circuitry - Glitch Hop
http://teknoaxe.com/Link_Code_3.php?q...

Background Music
Speo - Reminiscent
   • Speo - Reminiscent [Tasty Release]