Avoid incrementing the path tracer sample and frame index when not accumulating samples
#rb Lucas.Ammann
#preflight 60b9296239e5b70001d02463
[CL 16553724 by chris kulla in ue5-main branch]
Expose a checkbox on PostProcessVolume to control the path tracing denoiser.
Fix the hard clamp on samples/pixel since we don't have any internal limit. A UI clamp is sufficient.
Store the denoiser state in the path tracer config object so it does not get confused per View.
#rb Patrick.Kelly, Juan.Canada
#preflight 60b679deae46a100012ff351
[CL 16520779 by chris kulla in ue5-main branch]
This plugin implements a denoiser for path traced images using the OpenImageDenoise library. The denoiser is enabled by both loading the plugin and setting r.PathTracing.Denoiser=1
Add Albedo/Normal outputs to the path tracer to support the denoiser.
#rb Patrick.Kelly
#jira UE-79847
#robomerge[STARSHIP] -Starship-RES
#ushell-cherrypick of 16455905 by chris.kulla
[CL 16485986 by chris kulla in ue5-main branch]
This permutation will allow the path tracer to evolve independently from other RT passes in the engine. First end-user visible feature is that we disable RayTracingQualitySwitch for this permutation (so that path tracing can see the "full" material quality).
Introduce r.PathTracing cvar to guard the feature so that projects that don't need this functionality don't have to pay for the extra permutation.
Move raytracing clip/ddx/ddy into Common.ush
#jira UE-72537
#rb Patrick.Kelly, Yuriy.ODonnell
#preflight 60a7339365d94d0001bce99d
[CL 16415068 by chris kulla in ue5-main branch]
GPU Lightmass saw a performance regression after using more of the material model for translucent shadow support. Reclaim some performance by special casing more of the material logic for the subset that GPULM needs.
#rb Yujiang.Wang
#preflight 609ad275ab726700013a472c
[CL 16278525 by chris kulla in ue5-main branch]
This is another small step towards enabling path tracing specific shader permutations.
This requires re-caching the raytracing mesh commands when we flip to and from path traced rendering.
Cleanup some flag handling by removing the redundant ERayTracingRenderMode enum since it is already capture by show flags.
Avoid checking the path tracing flag per view since it is always common to all views
Re-introduce the deduplication over views for the non-path tracing case since ray tracing effects can be enabled in a view dependent fashion.
Rename CanOverlayRayTracingOutput to HasRayTracedOverlay which I think is a bit clearer. Note that the meaning has flipped - it now returns true when path tracing or ray tracing debug modes are enabled.
Remove leftovers of GAveragePathTracedMRays (which wasn't hooked up to anything anymore)
Refactor static variables used to store path tracing state into a pimpl object off of the ViewState
#rb Patrick.Kelly, Yuriy.ODonnell, Juan.Canada
[CL 16249998 by chris kulla in ue5-main branch]
Use the path tracer's skydome implementation for RT skylight, replacing the previous cubemap based implementation. The caching of the skydome texure and pdf is now done in a central location, which allows RT skylight, RT GI and the path tracer to share the same map. For static cases (captured sky or explicit cubemap) this work is only done once and re-used. For realtime capture cases (sky/atmosphere system), this work can happen each time the sky is updated (previously this case did not support RT skylight at all).
#rb Patrick.Kelly
[CL 16115098 by chris kulla in ue5-main branch]
The maximum path intensity is normally relative to the overall exposure. Since the path tracer accumulates accross frames we cannot tie the clamp to the exposure as it would lead to inconsistent results when interactively adjusting exposure during rendering (or create a strange feedback loop with eye adaptation).
Improve the path tracer setting tooltips in PPV a bit.
Minor cleanups to cvar descriptions, comment out unused cvars.
Cleaner empty buffer handling for LightGridData
Avoid redundant allocation and copy when uploading path tracer lights
#rb Juan.Canada
[CL 16051929 by chris kulla in ue5-main branch]
Add PPV flag to enable path traced emissive materials (on by default). These paths are not always needed if there are lots of tiny emitters, or if the scene was modelled with both emissive geometry and lights.
Change Skip* variables to Enable* to be more intuitive
Turn the sampler options into a proper enum since they were intended to be mutually exclusive
Tweak MaxPathIntensity logic to match Lumen and avoid color shifts
#rb Juan.Canada
#preflight 6079ba3dd400b70001571289
[CL 16036532 by chris kulla in ue5-main branch]
Split the light list info finite (point, spot, rect) and infinite (skydome, directional) sets. Build a 2d grid of which finite lights overlap particular regions. The grid is aligned to the bounding box of all lights and collapsed along the shortext axis so that memory usage scales quadratically with resolution instead of cubically. The light list per cell is currently pre-allocated up to a maximum count per cell (overflow is simply cut and lights are dropped as they were prior to this change). In most scenes I have tried so far this maximum is never reached with the current defaults of 256^2 resolution and 128 max lights per cluster.
#rb Patrick.Kelly
#preflight 60785d289e2d7a00016e3032
[CL 16022731 by chris kulla in ue5-main branch]
Use per lobe roughness instead of assigning a global roughness to all rays. This preserves reflected highlights better off of multi-lobed materials like dielectrics that have both a diffuse and specular lobe.
Add cvar to skip emissive shaders
This can be useful to debug noise coming from small emissive surfaces in the scene, or to deal with scenes that have both lights and modelled emitters.
Tweak transmission color to keep overall albedo under 1
Some assets with the twosided foliage or subsurface shading models have albedo over 1. Try to compensate for this by darkening both colors.
Fix potential bug with MIS weight calculation
#rb Patrick.Kelly
[CL 15855212 by chris kulla in ue5-main branch]
When enabled, shuffle pixel coordinate and share random number streams to improve the coherence of execution. This can provide large speedups (2x or more) on some scenes, and even modest speedups on complex scenes (30% or so). However it comes at the price of somewhat distracting artifacts at low sample counts that may be objectionable.
Leaving this disabled by default for now to gather feedback.
#rb Juan.Canada
[CL 15825443 by chris kulla in ue5-main branch]
If FRayTracingSceneInitializer.bExplicitMemoryManagement is true, the RHI will no longer internally allocate the TLAS buffer or SRV.
These should instead be explicitly created using regular RHICreateBuffer and RHICreateShaderResourceView APIs.
Buffer must be then bound to the scene using RHICmdList.BindAccelerationStructureMemory() before TLAS is built or any other GPU work is done.
#rb zach.bethel
[CL 15814201 by Yuriy ODonnell in ue5-main branch]
This patch just adds the basic support for evaluating the texture, it is not taken into account in the importance sampling. Also, currently limited to 8 slots like the RT path until we get proper bindless support.
#rb Patrick.Kelly
[CL 15751254 by chris kulla in ue5-main branch]
The random walk logic now can account for a colored mean free path. A new bsdf was added to account for the dual specular lobes.
Fix some weighting issues in transparency and avoid NaNs when the refraction mode is not based on IOR.
#rb Patrick.Kelly
[CL 15732683 by chris kulla in ue5-main branch]