There is most likely several threads to this already, but I’d like to know straight from Epic what the latest best practices are for 5.7 regarding mesh and cvar settings to remove the classic self-shadow artifacts from showing up. Right now we are targeting high-end gaming PCs for the HWRT builds.
Is this tutorial from 2022, tweaking “Fallback Relative Error” import settings still classed as the best approach to take? (skip to 3min 13secs)
Are you planning on using ray-traced shadows? The video and self shadowing artifacts from HWRT shadows made me assume you’re using ray traced shadows, but the repro steps don’t include turning on ray-traced shadows.
I checked with my colleagues and the situation with HWRT self-shadow artifacts doesn’t have recent significant improvements or workarounds - as long as the ray tracing proxy geometry and the Nanite geometry are different there will be self shadow artifacts. Setting the Fallback Relative Error to 0 and increasing the fallback mesh density, or using a custom ray tracing proxy may address self-shadowing artifacts at a specific distance from that object, but you’ll likely still see self-shadow artifacts as the underlying Nanite geometry changes based on the distance to the camera.
Megalights and Lumen use screen traces to work around discrepancies between the ray tracing proxy and Nanite mesh, and Lumen traces additional rays, which is something that can be done with HWRT shadows also with r.RayTracing.Shadows.AvoidSelfIntersectionTraceDistance
The solution that’s currently in development is using Nanite geo for ray tracing, similar to NV Mega Geometry, but even then, we’ll likely need some biasing (like VSM) to achieve the right balance of performance and quality.
r.RayTracing.Shadows.AvoidSelfIntersectionTraceDistance seems to be a great solution! Is there any performance impacts or caveats for using this cvar. I was finding values like 500-1000 in The Matrix city demo would solve the problem across the board.
Glad to hear that helps! Yes, r.RayTracing.Shadows.AvoidSelfIntersectionTraceDistance will have a performance impact, and you’ll want to profile GPU perf before/after because it affects how rays will be traced. The logic for it can be found in Engine/Shaders/Private/RayTracing/RayTracingOcclusionRGS.usf in the AVOID_SELF_INTERSECTION_TRACE section.