*Don't track modified bounds if they are outside of the interest range of Global Distance Field or Lumen
*Change FBox to FRenderBounds (4 bytes less per box)
*Try to keep PrimitiveModifiedBounds memory allocation based on the last frame's usage
#rb Daniel.Wright
#ROBOMERGE-SOURCE: CL 16697019
#ROBOMERGE-BOT: (v835-16672529)
[CL 16697029 by krzysztof narkowicz in ue5-main branch]
Adding FRDGUploadData to create upload data directly from the GraphBuilder persistent memory.
#jira none
#rb Zach.Bethel
#preflight 60c0de551264df00015e307a
[CL 16613071 by christopher waters 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]
Add nullptr check
This corresponds to CL15495515 in UE4 which won't automatically robomerge due to many changes in this file.
#rb trivial
[CL 15495650 by Jeremy Moore 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]
- View / InstancedView uniform buffers are now bound through RDG directly from the FViewInfo, or created on-demand for cases like jitter-free custom depth.
- Removed most of the custom persistent view uniform buffers. Left one in Lumen to be done in a later CL.
- ReflectionCapture uniform buffer is now bound at the RDG pass level.
#rb christopher.waters
[CL 14873982 by zach bethel in ue5-main branch]
- Added step after dynamic primitives are gathered to allocate a range in GPU scene for the dynamic primitives.
- Moved more GPU-Scene functionality to member functions to clean up references to internal data
- Removed the PrimitiveShaderDataBuffer/Texture from FSceneViewState
- Removed OneFramePrimitiveShaderDataBuffer/Texture from FViewInfo
- Encapsulated the collection of dynamic primitive data for upload to avoid uploading twice and prepare for parallel upload.
#rb Krzysztof.Narkowicz,graham.wihlidal
[CL 14785776 by Ola Olsson in ue5-main branch]
1. Cache trace hit points per voxel into a visibility buffer {meshId;HitT}
* All camera and object updates are cached and converted into a list of dirty bricks
* Build list of {brickId; meshId} for dirty regions
* Clear vis buffer for dirty regions
* Trace mesh SDF rays per list element, and scatter results with atomic into the vis buffer
2. Shade cached visibility buffer every frame
* Clear voxel lighting climap
* Compact voxel lighting vis buffer per brick
* Shade compacted bricks
Reverb, NV 1080, Clipmap 0 in cave (largest object density in Reverb):
Previous:
* 1.06ms
New one:
* Update cache for a 4 voxel scroll on diagonal - 0.18ms
* Reshade: 0.14ms
#rb Daniel.Wright
[CL 14514004 by Krzysztof Narkowicz in ue5-main branch]
Added single mip level to the global distance field clipmaps. Rebuild on any clipmap modification using Eikonal propagation and speeds up empty space skiping during tracing.
On 1080:
0.05ms to rebuild entire clipmap (mostly time spend in barriers between propagation passes)
FortGPUTestBed: ~17% faster tracing
Reverb Entrance: 3% faster tracing
Reverb Graveyard: ~27% faster tracing
#fyi Daniel.Wright
#rb none
[CL 14319372 by Krzysztof Narkowicz in ue5-main branch]