- Replaced FRW{Structured, ByteAddress}Buffer with TRefCountPtr<FRDGPooledBuffer>
- Replaced ResizeResourceIfNeeded with Resize{Structured, ByteAddress}BufferIfNeeded.
- Replaced FScatterUploadBuffer with FRDGScatterUploadBuffer.
- Removed awkward copy of page table buffers now that scatters are on the RDG timeline.
- Reduced number of uniform buffers created by consolidating within FLumenSceneFrameTemporaries.
- Fixed up const-correctness of FLumenSceneFrameTemporaries to sanity check that resources were not being mutated later in the frame.
- Reduced explicit view creations somewhat.
- Distance fields needs an FDistanceFieldSceneFrameTemporaries to cache RDG resources, but I held off on this due to the number of files it would touch.
#rb krzyzstof.narkowicz, daniel.wright
#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 19921040 via CL 19922067 via CL 19922607
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)
[CL 19925590 by zach bethel in ue5-main branch]
- Refactord 'Finalized Access' feature into a more flexible 'External' vs. 'Internal' access mode per resource toggle.
- Resources can transition between modes multiple times within the graph.
- Supports async compute pipeline.
- Supports queueing of requests to avoid back-to-back helper passes.
- This feature is needed to support conversion of GPU scene buffers.
- Deprecated the ReadOnly and ForceTracking resource flags and added a 'SkipTracking' flag instead.
- Previous semantics were confusing and error prone.
- New model requires a manual flag to tell RDG never to transition a resource.
- This flag is used for read-only dummy resources as an optimization.
- Renamed some of the auxiliary 'FinalizedResource' utilities since the name no longer matches the semantics.
#preflight 6266cc6d0634d0904ce4ba46
[CL 19904734 by zach bethel in ue5-main branch]
- Shaders sampling mesh distance fields must define OFFSET_DATA_STRUCT according to r.DFShadowOffsetDataStructure.
- Also renamed cvar r.DFShadowOffsetDataStructure to r.DistanceFields.OffsetDataStructure since it applies to all techniques sampling mesh distance fields.
#preflight 626661771a71643e8b8b07df
#rb Krzysztof.Narkowicz
#jira none
[CL 19900311 by tiago costa in ue5-main branch]
* Decreased Global Distance Field border from full voxel to half voxel and decreased page size from 16 to 8. This removes ~30% of pages, saving memory and improving update speed
* Half texel border requires to compute gradients using 8 page table fetches, but it didn�t influence Lumen tracing performance on console
* Smaller pages put some pressure on culling and other passes. Culling grid was switch from per page to per 4x4x4 pages. Overall full GDF update speed in FortGPUTestBed decreased from 5.89ms to 4.57ms
* Switched page table format to UInt32 in order to support larger Global Distance Field resolutions
* Moved all GlobalDistanceField shaders into /DistanceField/* folder, in future we should move other distance field shaders there
* Moved GlobalDistanceField page stats from r.Lumen.Visualize.Stats in Lumen code to r.GlobalDistanceField.Debug in GlobalDistanceField code
* Fixed Lumen normal visualization when only Global Distance Field tracing is enabled
#preflight 62630427006fa20b683b405a
[FYI] Tiago.Costa, Daniel.Wright
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19873116 via CL 19873429 via CL 19874251
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)
[CL 19878047 by krzysztof narkowicz in ue5-main branch]
FLinearColor has also been modified to make any double->float conversions explicit. Previously all 3D TVector versions were allowed to be implicit and thus could convert TVector<double> => FLinearColor => TVector4<float>.
Fixed up all engine and game casts. Added "//LWC_TODO: precision loss" around any explicit casts that previously were silently explicit and we may need to revisit for precision loss analysis.
#jira UE-122085
#rb Ben.Ingram, Andrew.Davidson
#preflight 61f24af473238441cb7bb0f1
#ushell-cherrypick of 18751249 by Zak.Middleton
#ROBOMERGE-OWNER: andrew.davidson
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 19478113 via CL 19493187 via CL 19493195
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v936-19480137)
[CL 19494217 by andrew davidson in ue5-main branch]
* Creates a half res Coverage atlas when Lumen is active, which tracks whether the region in space is occupied by two sided materials (foliage), which then get a smaller surface expand to reduce over-occlusion
* r.LumenScene.GlobalSDF.FullyCoveredExpandSurfaceScale, r.LumenScene.GlobalSDF.UncoveredExpandSurfaceScale
* A larger MinStepSize is used in two sided regions to accelerate tracing: r.LumenScene.GlobalSDF.UncoveredMinStepScale
Radiance Cache:
* Fixed allocator overflow corrupting the cache
* Probes placed for foliage trace at the lowest resolution
Screen Probe Gather:
* Two Sided Foliage shading interpolates from Screen Probes a second time using the backfacing normal
Radiosity:
* Ray directions are generated off of CardCoord instead of AtlasCoord, fixing a source of non-determinism
3.66ms DiffuseIndirectAndAO -> 3.73ms in a scene with no foliage
4.71ms DiffuseIndirectAndAO -> 6.05ms in a scene with heavy foliage, because fixing over-occlusion makes traces cost more
#preflight 621d89e5814dfc80784f1028
#jira UE-141204
#rb Krzysztof.Narkowicz
#lockdown Juan.Canada
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 19201289 in //UE5/Release-5.0/... via CL 19201886
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19214930 by daniel wright in ue5-main branch]
Workaround for DX11 AMD driver bug breaking world space radiance cache updates
Simple repro:
* Run default plane level on a AMD GPU with -dx11
* r.Lumen.RadianceCache.ForceFullUpdate 1
* r.Lumen.RadianceCache.Visualize 1
* Notice that some probes are black
Workaround for AMD driver bug breaking global SDF
* Enable Lumen or use r.AOGlobalDFResolution 224
* ShowFlag.VisualizeGlobalDistanceField 1
* Open default level with a plane, move plane away from the 1st clipmap, move it up and down, notice artifacts below it
Workaround for a bug in FMath::Clamp<int32>(int32, uint32, uint32) causing it to work as if it would be FMath::Clamp<uint32> and to overflow Lumen Scene atlas.
#lockdown Juan.Canada
#rb Danie.Wright
#preflight 6215174f840463c99a663425
#jira UE-143183
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19075983 in //UE5/Release-5.0/... via CL 19094535
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19136652 by krzysztof narkowicz in ue5-main branch]
Context:
- When texture is compiling, renderer uses a default texture instead.
- Compiling state is not reflected in bHasStreamingUpdatePending
- Distance to heightfield calculation involves a projection onto the heightfield normal which is incorrect when using default texture, resulting in distance to be 0 everywhere inside the heightfield xy bounds.
Change:
- check if HeightmapTexture->IsCompiling() in FLandscapeComponentSceneProxy::HeightfieldHasPendingStreaming().
- Only add primitive heightfield to UpdateRegionHeightfield if texture is not streaming or compiling.
#jira UE-142890
#preflight 620e18833609e193715f7e95
#rb Krzysztof.Narkowicz
#lockdown juan.canada
#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 19068236 in //UE5/Release-5.0/... via CL 19087982
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)
[CL 19130422 by tiago costa in ue5-main branch]
Misc:
* Renamed r.Lumen.DiffuseIndirect.MaxMeshSDFTraceDistance to r.Lumen.TraceMeshSDFs.TraceDistance as it controls also reflection traces
* Fixed Lumen global tracing mode with Landscape, which would only trace heightfields without any mesh SDFs and global SDF
* Disabled render target flag on GlobalSDF volume based on the recommendation from GCN guide: "For 3D images sampled from all directions (SDF tracing) Make sure to not flag for render target usage (forces possibly slower THIN tiling mode)" https://gpuopen.com/wp-content/uploads/2017/03/GDC2017-Advanced-Shader-Programming-On-GCN.pdf
#rb Daniel.Wright
#jira UE-142797
#preflight 620c2102565043444cac6101
#lockdown michal.valient
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 19010341 in //UE5/Release-5.0/... via CL 19010465 via CL 19010515
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 19010521 by krzysztof narkowicz in ue5-main branch]
Also:
* Added r.LumenScene.UpdateViewOrigin to stop updating Lumen VoxelLighting and Global Distance Field origin for debugging
* Fixed r.AOUpdateGlobalDistanceField
#jira none
#rb Tiago.Costa
#preflight 62043f02a65a8a28462f5361
#ROBOMERGE-AUTHOR: krzysztof.narkowicz
#ROBOMERGE-SOURCE: CL 18935058 in //UE5/Release-5.0/... via CL 18935132 via CL 18935213
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)
[CL 18935221 by krzysztof narkowicz in ue5-main branch]
- Don't allocate PageTableCombinedTexture and use PageTableLayerTextures[GDF_Full] instead.
- Accumulate all primitive modifications info GDF_Full cache when not caching mostly static objects separately.
#preflight 6202c158bf28c072cbf38641
#rb krzysztof.narkowicz
[CL 18910647 by tiago costa in ue5-main branch]
Remove unused param from ComposeHeightfieldsIntoPagesCS.
Added const keyword to GetHeightfieldRepresentation(...)
Remove TexCreate_RenderTargetable flag from VisualizeDistanceField texture since it is only used as UAV.
#fyi daniel.wright
#preflight 6202bbbd121599bf437e90a7
[CL 18906762 by tiago costa 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]
Issue:
- Can't rely on FComposeHeightfieldsIntoPagesCS to initialize pages in its current form
- Multiple heightfield components can write to the same pages.
- FComposeHeightfieldsIntoPagesCS only runs on pages that overlap with heightfield components.
Fix:
- Run FComposeObjectsIntoPagesCS even when scene doesn't contain any mesh SDFs.
- It will initialize all pages that require it.
- Added FProcessDistanceFields permutation to skip iterating through mesh SDF lists when scene doesn't contain any.
#preflight 61f98390c54b18c42dd9b30a
#rb krzysztof.narkowicz
#ushell-cherrypick of 18812568 by tiago.costa
[CL 18823420 by tiago costa in ue5-main branch]
- Deprecated legacy members from FPooledRenderTargetDesc.
- Deprecated ETextureRenderTarget and removed from RDG.
- TargetableTexture always equals ShaderResourceTexture.
- Simplified render target pool FindFreeElement.
- Create pooled buffers and textures with a known state.
#rb graham.wihlidal
#preflight 61f8488568795b2f45852274
#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18796880 in //UE5/Release-5.0/... via CL 18797840 via CL 18799070
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
[CL 18799188 by zach bethel in ue5-main branch]
- Multiple branches that only checked for mesh SDFs needed to be updated.
- New permutation of AllocatePagesCS to skip mesh SDFs when none are in the scene.
- New permutations of ComposeHeightfieldsIntoPagesCS to support composing with None/Previous/Parent.
- Previous - compose with mesh SDF pages.
- Parent - compose with mostly static pages.
- Improvements to distance field visualization mode conditions.
#rb Krzysztof.Narkowicz, Patrick.Kelly
#preflight 61f7af8fe55232619f74490f
#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18787631 in //UE5/Release-5.0/... via CL 18787637 via CL 18787659
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18787662 by tiago costa in ue5-main branch]
FLinearColor has also been modified to make any double->float conversions explicit. Previously all 3D TVector versions were allowed to be implicit and thus could convert TVector<double> => FLinearColor => TVector4<float>.
Fixed up all engine and game casts. Added "//LWC_TODO: precision loss" around any explicit casts that previously were silently explicit and we may need to revisit for precision loss analysis.
#jira UE-122085
#rb Ben.Ingram, Andrew.Davidson
#preflight 61f24af473238441cb7bb0f1
#ROBOMERGE-AUTHOR: zak.middleton
#ROBOMERGE-SOURCE: CL 18751249 in //UE5/Release-5.0/... via CL 18751253 via CL 18751319
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18751326 by zak middleton in ue5-main branch]
Project
* Ray Lighting Mode - project wide control for ray lighting quality
Post Process Volume
* Lumen Scene Lighting Quality - drives Radiosity gather quality
* Lumen Scene Detail - drives Lumen culling aggressiveness
* Lumen Scene View Distance - controls the distance from the camera that Lumen Scene will be maintained
* Lumen Scene Lighting Update Speed - drives Radiosity gather convergence speed
* Final Gather Lighting Update Speed - drives Final Gather temporal accumulation strength
* Max Trace Distance - the distance that Lumen features will trace through the scene
* Ray Lighting Mode - local control for ray lighting quality
Primitive Component
* Emissive Light Source - provides a hint to Lumen that the mesh has an important lighting contribution and should not be culled
Replaced r.Lumen.MaxTraceDistance with r.Lumen.MaxTraceDistanceScale
Increased MAX_GLOBAL_DF_CLIPMAPS to 6
#rb Krzysztof.Narkowicz
#preflight 61ef58b8ca3de856bce72093
#ROBOMERGE-OWNER: krzysztof.narkowicz
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 18743987 in //UE5/Release-5.0/... via CL 18744701 via CL 18745671
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)
[CL 18745941 by krzysztof narkowicz in ue5-main branch]