Forward rendering now supports up to four shadow casting light, which are stored into the various channels of the shadow masks textures. This CL ensures that the hair mask is written in the proper channels. It also fixes potential light leaks due to invalid transmittance initialization when shadow mask is fully opaque.
#rb none
#jira none
#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18387421 in //UE5/Release-5.0/... via CL 18387432
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)
[CL 18387447 by charles derousiers in ue5-release-engine-test branch]
- Add some dither noise to both the SMRT result and the shadow mask lookup to minimize banding
- Fall back to a single sample VSM lookup (with a generous static bias) when overflowing the number of lights in one pass projection path
- Fix clamping issue with page dilation that was setting extraneous pages with point lights
- Fix SMRT issue with local lights jammed right next to geometry viewed at a distance
- Separate settings for page dilation for local and directional lights
- Add simple debug output for # lights in one pass projection
- Remove some dead code/parameters
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18279117 via CL 18373418 via CL 18373449
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)
[CL 18373485 by andrew lauritzen in ue5-release-engine-test branch]
This represents UE4/Main @18073326, Release-5.0 @18081140 and Dev-PerfTest @18045971
[CL 18081471 by aurel cordonnier in ue5-release-engine-test branch]
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035
[CL 17918595 by aurel cordonnier in ue5-release-engine-test branch]
The intention is that lights will eventually take this path automatically when no geometry that can't be rendered into a VSM is present (or no such types exist anymore in the engine).
Fix a few cases where assumptions are made about VSMs only existing if a conventional shadow map exists and so on.
Allow Lumen to consider the VSM result "complete" if valid and no shadow map is present.
#rb Krzysztof.Narkowicz
[FYI] Ola.Olsson
#preflight 611d64805e73720001df629c
#ROBOMERGE-SOURCE: CL 17221692 via CL 17221701
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v855-17104924)
[CL 17221712 by andrew lauritzen in ue5-release-engine-test branch]
- Add VirtualShadowMapId to forward light data, removing the per-view remapping table. Should fixe a few multi-view/split-screen bugs.
- Minor cleanup of PCF subsurface path; remove dead/broken code.
- Fix up blending of light attenuation into screen shadow mask; disable CSM fading when VSMs are enabled.
- Fix OnePassProjection flag when VSMs are disabled
#rb none
[FYI] ola.olsson, brian.karis
#ROBOMERGE-SOURCE: CL 16852407 via CL 16852415
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)
[CL 16852422 by andrew lauritzen in ue5-release-engine-test branch]
- Pass shader parameter to disable direct lighting in forward shading when show flag is off
- Fix shadowed lights still getting injected into translucent light volume even when directlighting show flag disabled
#jira UE-102506
#rb graham.wihlidal
[FYI] ola.olsson
#ROBOMERGE-SOURCE: CL 15856585 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)
[CL 15857270 by andrew lauritzen in ue5-main branch]
* SDFs are now generated, allocated from the atlas and uploaded in 8^3 bricks (7^3 unique data, half voxel padding).
* Tracing must load the brick index from the indirection table, and only bricks near the surface are stored
* 3 mips are now generated, with the lowest resolution always loaded and the other 2 streamed
* SDFs are now G8 narrow band. Lower resolution mips must be traversed when querying distance to nearest surface far away from the surface
* The Distance Field Brick Atlas is now stored for each FScene and dynamically resized based on needs with a GPU memcopy
* Brick atlas uses a 1d pooled allocator which has no fragmentation and greatly reduces packing waste over the 3d allocator
* Added new indirection for Distance Field Asset data, so that only a single entry needs to be updated when a mip is streamed in or out in scenes with millions of instances
* Compute shaders operating on distance field instances generate streaming requests, which are async read back to CPU, turned into IO requests, which are polled and when complete uploaded to atlases
* Any mesh instance inside the Global SDF extent (200m) requests mip1, and at 50m requests mip2
* Now using a batched compute scatter to upload to the distance field atlas instead of RHIUpdateTexture3d, to bypass alignment restrictions and per-upload overhead
* Distance Field streaming uses an async task to move Memcpy and IO request overhead off of the Rendering Thread
* Distance Field Visualization now computes a normal from the SDF gradient and does simple lighting to better visualize the scene representation
* Increased r.DistanceFields.MaxPerMeshResolution from 128 to 512, to better represent large objects
* Mesh SDF generation now uses an Embree point query to calculate closest unsigned distance, and then a much smaller set of rays to count backfaces for negative region determination, for a 11x speedup
* Upgraded mesh utilities to Embree 3.12.2 to get point queries
* Fixed wrong transform used for SDF normals in Lumen, causing non-uniformly scaled meshes to have incorrect Surface Cache interpolation
* Fixed Static Mesh materials not getting PostLoaded before SDF build, causing their blend modes to be wrong for the build, which corrupts the DDC. Also included those blend modes in the DDC key.
Original costs on 1080 GTX (full updates on everything and no screen traces)
10.60ms UpdateGlobalDistanceField
3.62ms LumenReflectiveTest.DirectionalLight_1 Shadowmap 1
1.73ms VoxelizeCards Clipmaps=[0,1,2,3]
0.38ms TraceCards 1 dispatch 1 groups
0.51ms TraceCards 1 dispatch 1 groups
Sparse SDF costs
12.06ms UpdateGlobalDistanceField
4.35ms LumenReflectiveTest.DirectionalLight_1 Shadowmap 1
2.30ms VoxelizeCards Clipmaps=[0,1,2,3]
0.69ms TraceCards 1 dispatch 1 groups
0.77ms TraceCards 1 dispatch 1 groups
Tested: TopazEntry PC, Reverb PC and PS5, EngineTests, QAGame, Rift, Frosty P_Construct_WP, FortGPUTestbed
#rb Krzysztof.Narkowicz
#ROBOMERGE-OWNER: Daniel.Wright
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 15784493 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)
#ROBOMERGE-CONFLICT from-shelf
[CL 15790658 by Daniel Wright in ue5-main branch]
- Move VSM parameters into a single uniform buffer; required for base pass rendering.
- SRVs are initialized to dummy data until they are computed during the frame and subsequently updated before any VSM sampling.
- Make names and usage more consistent with other UB bindings in mesh passes
- Direct injection of VSM into translucent volume and fog
- Support VSM sampling in forward lighting shaders
- Enabled and bound currently for translucent forward and single pass water meshes
- Support VSM sampling in sky atmosphere and cloud rendering
- NOTE: Sky atmosphere LUT pass currently executes before BasePass and ShadowDepths so it will not sample proper data and throw a warning. Moving passes around to address this will come in a future commit.
#rb Brian.Karis, Ola.Olsson, Sebastien.Hillaire, Zachary.Bethel
#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15649858 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v779-15635321)
#ROBOMERGE-CONFLICT from-shelf
[CL 15650486 by andrew lauritzen in ue5-main branch]
* These map to r.DynamicGlobalIlluminationMethod and r.ReflectionMethod under the hood
* Removed r.ssgi.enable. Projects with r.ssgi.enable=1 lose SSGI being enabled, because there�s no way to do backward compatibility on cvars.
* Removed r.LumenScene. Lumen GI and Reflections are now enabled independently and Lumen Scene will be set up if either feature is enabled.
Setting �Dynamic Global Illumination Method� to Lumen in Project Settings automatically sets �Reflection Method� to Lumen and enables �Generate Mesh Distance Fields�, so you only have to change one setting to convert your project to Lumen.
Newly created projects have:
* r.GenerateMeshDistanceFields=True. Needed for Lumen Software tracing. Note this means all new projects have Mesh Distance Field memory overhead by default.
* r.DynamicGlobalIlluminationMethod=1 (Lumen)
* r.ReflectionMethod=1 (Lumen)
Added GI method and Reflection method overrides to Post Process Volume, and new Final Gather Quality and Reflections Quality for Lumen.
Changed the default for r.DistanceFields.DefaultVoxelDensity from .1 to .2, for all projects. This is needed for good software tracing quality with Lumen.
Lumen GI operates on all lights, regardless of Mobility. Precomputed shadowing on Stationary lights are ignored, and Lumen will fall back to SDF tracing to solve shadowing for these.
When Lumen GI is enabled, lightmap lighting is discarded in the shader. This breaks Static lights with lighting built, because their direct lighting is only stored in the lightmap. A future change will be needed to render Static Lights when Lumen GI is enabled.
NeedsVelocityDepth will be true on any platform that supports Lumen or Ray Tracing. Lumen needs Velocity Depth but doesn�t have a readonly cvar to use to modify shader compilation.
#ROBOMERGE-SOURCE: CL 15321505 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15321508 by daniel wright in ue5-main branch]
Major SMRT optimization. Adaptive 7 rays per light with rough penumbra detection. Quality appears to surpass 1rpp with denoising.
#rb andrew.lauritzen
[CL 15190972 by Brian Karis in ue5-main branch]