- Decals materials are evaluated using callable shaders in PathTracingKernel.
- Decals are culled using a 2D grid similar to the existing light grid.
- In order to correctly handle decal blending order, decals are sorted using the same logic as the rasterizer on CPU. The compute shader that builds the decal grid maintains the correct order.
- Decal materials are wrapped in FRayTracingDecalMaterialShader. The instance parameters of each decal are bound using uniform buffers.
#preflight 628f3fed2f2409bc1e7a6414
#rb Yuriy.ODonnell, chris.kulla, Jeremy.Moore
[CL 20377336 by tiago costa in ue5-main branch]
- useful to gather shader bindings to evaluate materials in callable shaders.
- similar to how it supports compute and hit group shaders.
#rb yuriy.odonnell
#preflight 6287503ac057ee6e23f2f8dc
[CL 20292265 by tiago costa in ue5-main branch]
- Updated places accessing TLAS SRV to use ERayTracingSceneLayer::Base
#rb yuriy.odonnell
#preflight 62728a70ec1566a70616ac9a
[CL 20041705 by tiago costa in ue5-main branch]
This should render black, with alpha controlled by the opacity.
#jira UE-149843
#rb Juan.Canada
#preflight 626c0be0ce3959ce8fe57a38
[CL 19980869 by chris kulla in ue5-main branch]
Remove coherent sampler since it would be complicated to support in the mGPU case and isn't really necessary for performance anymore
#rb Jason.Hoerner
#preflight 624b79f09f404234149aec8e
[CL 19617353 by chris kulla in ue5-main branch]
Fix RHI validation errors on "TilePositionsBufferForClear" by moving this buffer to RDG
Fix broken IES support from bad merge
Remove unused View parameter from PrepareLightGrid
Fix several shader compilation warnings
#rb Juan.Canada
#jira none
#preflight 62338a2fe12e0da4a5315444
[CL 19425053 by chris kulla in ue5-main branch]
The logic was nearly identical between both cases, refactoring allows us to share more code and remove virtual calls from FRayTracingMeshProcessor.
Also cleanup the way supported Vertex Factory types are detected by adding a new vertex factory flag.
#rb Juan.Canada
#preflight 6227967d31133a23da4a56bf
[CL 19305870 by chris kulla in ue5-main branch]
This is the start of volumetric support in the path tracer, so a lot of basic infrastructure had to be put into place, making this changelist fairly large. Some shuffling of light parameters had to be done to make room for the volumetric scattering multiplier.
The integration strategy is to use null tracking (with Spectral MIS) for choosing a random scatter point along the ray. This point is chosen similarly to transparent hits, so surface and volume shading are unified. However, these volume hits are chosen proportionally to transmittance times scattering which is not optimal for lights embedded in the volume. To handle the latter, we also allow the main trace call to return a volume segment over which we can compute the direct lighting from local light sources. To simplify the handling of overlapping media and inter-mixed transparent hits, we stochastically select a ray segment. From this point on, we can evaluate direct lighting using equi-angular sampling. The MIS combination of equi-angular sampling and null tracked spectral density sampling was prototyped but found not to bring any improvement for the currently implemented volume types. This will likely have to be revisited in the future.
To improve quality and reduce the amount of ray-marching required, the volume API allows for analytic implementations of transmittance for cases where this is possible to do more efficiently than by ray-marching.
Implementation details for Atmosphere: This volume type is a planet sized, spherically symetric model. Because the default units in UE are centimeters, objects like the planet that are kilometer sized will run into all sorts of numerical precision artifacts. To solve this, an implementation of double-word arithmetic was added which allows enough decimal digits to robustly intersect the planet, as well as cary out the lookups required. The Transmittance is cached in a lookup table indexed by height above the ground and viewing angle cosine. This is similar to the LUT used by the realtime version but with a different parameterization which covers the full range of angles/heights with high precision. This lookup table is automatically baked on demand when atmosphere parameters change. The volumetric sky model is only used when "reference atmosphere" is enabled in the post process volume. This is because the existing approached (cached into a skylight) is generally a bit faster and supports clouds. This toggle may be removed as the support for volumes matures.
Implementation details for ExponentialHeightFog: This volume is represented as a finite slab centered around the camera. Transmittance is easily computed analytically for this volume. We only add this volume when the volumetric fog checkbox is enabled, as the default parameters are not fully physically based. We limit the fog to be present only within a certain radius of the camera, to prevent rays from scattering forever.
#preflight 620ad32d583261b0a66af216
#rb Sebastien.Hillaire,Patrick.Kelly
#preflight 620dd2270931bfd925e5936b
[CL 19031069 by chris kulla in ue5-main branch]
This changes allow to bind a larger amount of rect. light texture, and allows future support for rect light in forward & cluster passes.
#jira none
#rb sebastien.hillaire
#preflight 61fcebd0b5092d45ad110db4
[CL 18861192 by Charles deRousiers in ue5-main branch]
Default value is 2 (flush after each tile) to minimize the overhead when path compaction is used.
#jira UE-140993
#rb Juan.Canada
#preflight 61fac666815d546ad398e880
#ushell-cherrypick of 18793549 by chris.kulla
#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18830206 in //UE5/Release-5.0/... via CL 18830317 via CL 18830778
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18830794 by chris kulla in ue5-main branch]
#jira UE-122078
#rb Andrew.Davidson, Colin.McGinley
#preflight standard build
#ROBOMERGE-AUTHOR: fred.kimberley
#ROBOMERGE-SOURCE: CL 18817999 in //UE5/Release-5.0/... via CL 18818012 via CL 18822871
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18824721 by fred kimberley in ue5-main branch]
- Store Position and Bounds in translated world space
- Not using TilePosition+RelativeWorldPosition to avoid increasing struct size.
- FPathTracingLight arrays seem to be calculated every frame so shouldn't be a problem.
- LightGrid fully built in translated world space.
- TraceLight/SampleLight/EstimateLight/InitLightPickingCdf now expect rays and positions in translated world space.
#preflight 61f98c744b0bc1c4176461df
#rb chris.kulla
#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18813277 in //UE5/Release-5.0/... via CL 18813296 via CL 18822754
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
[CL 18824289 by tiago costa in ue5-main branch]
- not yet taking full advantage of LWC since light positions are still sent to shader as world space floats.
#preflight 61f9535e8b4112f7cc9a3600
#rb Chris.Kulla
#ushell-cherrypick of 18809796 by tiago.costa
[CL 18823427 by tiago costa in ue5-main branch]
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8700e41414fb013dd4002
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18801433 in //UE5/Release-5.0/... via CL 18802090 via CL 18821511
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
[CL 18821594 by andrew davidson in ue5-main branch]
Implement tiled dispatch in the path tracer to reduce the likelyhood of GPU timeouts when rendering at high resolution. This also reduces the memory requirements for path state when running with path compaction enabled.
Change from a uint buffer to a structured buffer for storing path states which gives a small speedup.
Add indirect dispatch support to launch less work for compacted bounces (off by default as it does not seem to provide a speedup so far)
#jira TM-6595
#rb Juan.Canada
#robomerge 5.0
#preflight 61b27c6a2b48d03df526ce85
#preflight 61b28773ee0de9822e0f02de
[CL 18426885 by chris kulla in ue5-main branch]
Add support for binding a ray tracing material to hair strands so that they can show up in path tracing.
Add hair shading model to path tracer
#rb Charles.deRousiers
#preflight 618e9d3b857f308d859d696a
#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18170915 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v894-18169371)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0
[CL 18170941 by chris kulla in ue5-release-engine-test branch]
This implements a ray-traced sampled depth of field which can serve as a ground truth for the post processed depth of field. Users can select between reference quality or post processing with a path tracing specific checkbox in the post process settings.
#rb Guillaume.Abadie,Patric.Kelly,Juan.Canada
#preflight 618bf5abb253729fe2230d0e
#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18131692 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0
[CL 18131775 by chris kulla in ue5-release-engine-test branch]
This cvar mainly controls the creation of path tracer specific material permutations. Projects which know they do not want to make use the path tracer should turn this off. Note that the DataDrivenPlatformInfo is also checked to make sure the path tracer is supported on a given platform.
#rb Juan.Canada
#p4v-preflight-copy 18094497
#preflight 6189b0b6c717ba4e92145c31
#ROBOMERGE-AUTHOR: chris.kulla
#ROBOMERGE-SOURCE: CL 18096618 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v889-18060218)
#ROBOMERGE[STARSHIP]: UE5-Release-Engine-Staging Release-5.0
[CL 18096707 by chris kulla in ue5-release-engine-test branch]