* Add missing water Material ID cases for material hit shaders
* Make water translucent in the initial version
* Disable underwater postprocess material when running PT
#rb Chris.Kulla
#preflight 629725f92a1851b4ccb93408
[CL 20450504 by aleksander netzel in ue5-main branch]
- 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]
- fix for shader compilation on an NDA'd platform introduced in CL 20008404
#rb none, trivial
#jira none, CIS error
#rnx
#preflight 626ff999ad00dced62ce4325
#fyi Yujiang.Wang
[CL 20010260 by eric mcdaniel 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]
If we want to re-introduce this notion, we should be able to handle this directly in the material given the world position and camera matrix.
This frees up 4 bytes (in preparation for Strata support) and also reduces the path state structure size by 4 bytes.
I've measured around 3% speedup from this removal.
#rb Yuriy.ODonnell,Charles.deRousiers
#preflight 626ae4926461dd769ffe4394
[CL 19966893 by chris kulla in ue5-main branch]
Irradiance Caching
* Instead of setting a per-cell cap of samples, now we use the first X path samples of the receiver (lightmap texels) to adaptively distribute the irradiance cache samples. This will distribute them where BRDF sampling thinks the most important (more around corners and fewer in open area, for example). This is also the distribution that the old school irradiance caching's distance-based heuristics approximates for.
* New cache cells are only spawned during the first X passes. This avoids the case where the cache is constantly thrashed when it is not big enough to cover the scene.
* The image is reset after the first X passes are done. Like path guiding, these passes are uncached and thus contain high variance. Mixing them with the passes later will actually increase overall variance.
First Bounce Ray Guiding
* Now the FBRG passes run after IC passes are done. Way less input noise into the guiding PDF and better at locating importance sources.
New Parameter Tweaking Strategy for IC and FBRG
* IC: set quality to 1/16-1/8 of GI samples. Increase when seeing bright splotches around corners, or color discrepancies over large area.
* FBRE: set trial samples to 1/4 of GI samples. Increase when fireflies or small square-shaped artifacts are introduced by this technique.
General Cleanups
* IC and FBRG passes now add to the total number of passes to render instead of being subtracted from the number of GI Samples to reduce user confusion.
* IC buffer size reduction to save some GPU memory.
#rb juan.canada
#preflight 625ef3cb5f498a37c921b2f0
[CL 19815248 by Yujiang Wang in ue5-main branch]
1. Use the decoding used by raster for the path tracer.
2. Use direct encoding from material roughness to lobe roughness instead of going through the average, which leads to underestimation (2%) and clamping (20%) of the value space.
Also clean up the code a little.
#jira UE-148244
#rb chris.kulla, sebastien.hillaire, krzysztof.narkowicz
#preflight 624f17ce6d3bb118aaf08c74
[CL 19673284 by Tiantian Xie 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]
- Can be used to output 32 bits worth of data from ray tracing intersection shaders.
- Enabled by defining RAY_TRACING_SUPPORT_CUSTOM_UINT_IN_INTERSECTION_ATTRIBUTES in Vertex Factory.
- When enabled, barycentrics are stored using half precision floats.
- Renamed FDefaultAttributes to FRayTracingIntersectionAttributes.
#rb yuriy.odonnell
#preflight 6246c547981a2c8eb48d7715
#jira none
[CL 19586038 by tiago costa in ue5-main branch]
## Major benefit
* SSS rasterizer matches as close as possible to pathtracer without transmission. Ultimate goal is the user can use rasterizer to look and dev subsurface scattering.
* SSProfile will use mfp. Next is to unify all scattering parameters to mfp.
* Smooth upgrade for rasterizer/raytracing real-time renderer. Path tracer appearance will match rasterizer as previously the parameters are used differently for path tracer and rasterizer.
* Path tracer supports SSS below 1mm.
## The break down of the CL
0. Use mfp instead of dmfp to select the channel to scatter (CL19255292).
1. Match burley high quality rasterizer with pathtracer in ideal SSS condition (CL19227570).
2. Match the low quality burley, separable filter(CL19244046).
3. Upgrade dmfp to mfp in UI. (This one includings all previous CLs).
## Issue
There are two issues I am hunting down
0. Need to scale the scatter distance by 2 for separable filtering so that it matches MC sampling in high quality Burley.
1. Need to scale down the mfp by a magic number 0.6 to match path tracer with high quality burley. However it has no impact for new SS profiles. The mfp is as it is.
#jira UE-138109
#preflight 622f933e511d438d6b5cbccc
[CL 19377844 by Tiantian Xie in ue5-main branch]
This speeds up the main trace loop by requiring fewer random numbers to be generated.
#rb Patrick.Kelly
#preflight 621e5d8fe15c51d8c5d4dbe7
[CL 19201993 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]
- Raytracing shadows/reflections/AO/GI/etc and path tracer now work in large worlds.
- Updated parts of Lumen using raytracing to work in large worlds.
- This change doesn't not address (all) GPU Lightmass issues in large worlds.
Changes:
- Build TLAS with instances in translated world space.
- Move ray origin to translated world space.
- Updated raytracing shaders to use translated world space (most LWCHackToFloat in these shaders are now gone).
- Store gather points positions in translated world space.
- Removed unused RayTracingDynamicMeshVS(...)
#rb Yuriy.ODonnell, Patrick.Kelly, chris.kulla, rob.krajcarski
#jira UE-140558
#preflight 620bb3ff4353dc61c7f51e64
[CL 18995354 by tiago costa 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]
- 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]