Commit Graph

69 Commits

Author SHA1 Message Date
Ola Olsson
e9276fc6db Combing GPU-Scene instance culling and the id-list generation into one step, and the same for VSM
- Uses the InstanceCullingLoadBalancer to pre-distribute the work on the CPU to ensure even load.
 - Make instance culling use the instance data offset in MDC instead of translating primitive IDs.
 - Track single-instance draws separately from instanced to optimize handling (disable culling for single-instance primitives).

#rb Graham.wihlidal,andrew.lauritzen
#fyi dmitriy.dyomin
#preflight 60d0eafa2ab2180001269160

[CL 16733827 by Ola Olsson in ue5-main branch]
2021-06-21 16:51:39 -04:00
andrew lauritzen
54ae421ce0 Use conservative CPU cull volume for VSM clipmaps to avoid missing non-nanite geometry in cached pages.
Better labeling for some GPU profiling regions.
Fix to frustum vertex buffer usage flag.

#rb ola.olsson


#ROBOMERGE-SOURCE: CL 16675237
#ROBOMERGE-BOT: (v835-16672529)

[CL 16675244 by andrew lauritzen in ue5-main branch]
2021-06-15 12:46:58 -04:00
graham wihlidal
1b2976b0c9 Big cleanup/refactor of InstanceData* (renamed to InstanceSceneData* to match many other places already calling it that, and to disambiguate upcoming changes that add another instance data buffer to GPU Scene for arbitrary data payloads). This change also removes the virtuals on FPrimitiveSceneProxy for the instance list along with lots of copy paste code for all the derived types, and instead makes it a built-in feature of the base proxy (since nearly everything supports GPU Scene instancing now).
#rb ola.olsson
[FYI] brian.karis
#preflight 60c4d5c586ce760001377f2a


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16660135
#ROBOMERGE-BOT: (v834-16658389)
#ROBOMERGE-CONFLICT from-shelf

[CL 16660883 by graham wihlidal in ue5-main branch]
2021-06-14 13:42:46 -04:00
Ola Olsson
91ed2ab3ba Move instance ID buffer to RDG and out of the View uniform buffer and into own UB.
- Enables overlapping batched and non-batched instance culling (needed for batching work).
 - Removes some explicit transitions & minor cleanup.
 - Added tracking the required number of instances (fixes non-nanite VSM for large ISMs)

#rb graham.wihlidal,jian.ru,yujiang.wang,zach.bethel
#preflight 60b73f38107dc600017d931b

[CL 16544217 by Ola Olsson in ue5-main branch]
2021-06-03 02:19:28 -04:00
andrew lauritzen
e9c2267b53 Fix CPU-side structure to align with padding added to GPU structure.
#rb Charles.deRousiers

#ROBOMERGE-SOURCE: CL 16510863 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v826-16501804)

[CL 16510864 by andrew lauritzen in ue5-main branch]
2021-05-31 16:52:31 -04:00
andrew lauritzen
c373a4445f Fix depth range precision and offset/clamping issues with VSM cached pages
- Instead, create a reference depth range with a guard band that we reuse frame to frame until we get too close to the edge, at which point we invalidate that clipmap level's cached pages (if any)
- Does not significantly affect invalidations, even when moving quickly near surfaces, since those cases would already get invalidated when those pixels moved to a different clipmap level
- Sets up for not re-copying cached VSM pages every frame

#rb ola.olsson
[FYI] brian.karis

#ROBOMERGE-SOURCE: CL 16492432 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v823-16466674)

[CL 16492445 by andrew lauritzen in ue5-main branch]
2021-05-27 17:36:27 -04:00
zach bethel
2ab8c34577 Replaced FRDGBufferUploader with internal RDG upload. Removes several transitions and passes and removes immediate command list passes from the graph.
#rb jian.ru

[CL 16459303 by zach bethel in ue5-main branch]
2021-05-25 20:46:17 -04:00
andrew lauritzen
93dd5946b6 Re-implement debug output visualization for VSM projection
Use actor label for light identification/selection in editor; fall back on component name (UUID) temporarily until this data is made available outside the editor as well
Collect debug data in RayState for SMRT and return the last valid sample data
- Alternative is to always generate debug data based on just a single VSM sample even when SMRT is enabled, but it's useful to have a debug output path for the true SMRT data, even if a bit more complex
Move some common visualization utilities to /Visualization.ush
Implement but disable backface culling for shadow evaluation pending change that handles various SHADINGMODEL's properly

#rb graham.wihlidal, ola.olsson

#ROBOMERGE-SOURCE: CL 16407102 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16412421 by andrew lauritzen in ue5-main branch]
2021-05-20 19:32:20 -04:00
richard wallis
2eef69096c PhysicalPagePool needs to be UInt compatible and PhysicalPagePoolHw needs to be float compatible. Slightly modified version of CL by Andrew Lauritzen after testing on macOS Big Sur.
#jira UE-116080
[REVIEW] [at]Andrew.Lauritzen,  [at]Juan.Canada,  [at]will.damon

#ROBOMERGE-SOURCE: CL 16406023 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v804-16311228)

[CL 16406075 by richard wallis in ue5-main branch]
2021-05-20 13:24:00 -04:00
graham wihlidal
36beb84c0e - Added the ability to disallow falling back to proxy meshes if Nanite isn't supported by the platform (or if it is, but atomics are not supported). Default is proxy rendering, but some projects may not be built with proxy fallback in mind. Controlled with r.Nanite.ProxyRenderMode (0=fallback, 1=never render, 2=never render except SM editor toggle).
- Require 64bit atomic support for Nanite by default now (r.Nanite.RequireAtomic64Support=1)
- Cleaned up a bunch of cvar component reattach callbacks to use lambdas instead of redundant global functions
- Added UStaticMesh::HasValidNaniteData() as a helper to check if an asset has valid Nanite data
- Improved Nanite unsupported on screen error message so that we don't asks the user to update GPU drivers on a console :)

#rb nick.whiting
#jira UETOP-1646
[FYI] brian.karis, michal.valient

#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16363554 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v804-16311228)
#ROBOMERGE-CONFLICT from-shelf

[CL 16363648 by graham wihlidal in ue5-main branch]
2021-05-17 22:54:18 -04:00
zach bethel
7c28e71d9e Batch RDG upload passes together to reduce transitions and RDG compilation work.
#rb charles.derousisers, andrew.lauritzen
#jira UE-114621

[CL 16209728 by zach bethel in ue5-main branch]
2021-05-05 13:20:09 -04:00
Charles deRousiers
212469d965 Add indirect tile dispatch for marking shadow page covered by hair.
Review:  https://p4-swarm.epicgames.net/reviews/15901055/v1/

#rb andrew.lauritzen
#jira none

[CL 16182843 by Charles deRousiers in ue5-main branch]
2021-05-03 05:07:00 -04:00
andrew lauritzen
2b2b3adc5f Add a shadow depth VS permutation for non-nanite vsm to avoid the need for a read-only project setting
PS already has a permutation (bAtomicWrites) so this primarily affects offline compilation
Leaving the function of NonNaniteVSM the same for now to minimize the surface area of the change, but the shader and other logic can be simplified in the future
NonNaniteVSM can become a dynamic debug cvar in the future once we are happy this is working

#jira UETOP-1088
#lockdown graham.wihlidal
#rb ola.olsson, krzysztof.narkowicz
[FYI] nick.whiting

#ROBOMERGE-SOURCE: CL 16057407 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16061153 by andrew lauritzen in ue5-main branch]
2021-04-20 10:31:17 -04:00
rolando caloca
54bec85390 UE5EA - Enable Nanite on Vulkan, fixes rendering issues
[FYI] Mihnea.Balta
#rb Zach.Bethel, Brian.Karis

#ROBOMERGE-SOURCE: CL 16038169 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16038203 by rolando caloca in ue5-main branch]
2021-04-16 15:06:03 -04:00
andrew lauritzen
181bc2e497 Reenable VSM HZB to help with some of the Nanite buffer overrun cases
Add virtual clipmap levels near the camera to cover extreme close-ups
Add Nanite view compation debug output
Make VSM resolution lod bias consistent for directional and local lights
Remove some unnecessary code from ProjectionCommon.ush which gets included in material shaders

#jira UETOP-1088
#rb graham.wihlidal, ola.olsson
[FYI] brian.karis
#lockdown graham.wihlidal

#ROBOMERGE-SOURCE: CL 15994600 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 15994621 by andrew lauritzen in ue5-main branch]
2021-04-13 16:54:28 -04:00
simon tourangeau
d42f8bc6da Separate CVar for HZB for VSMs vs Atlases.
Add light name to non-nanite VSM raster passes.

#rb graham.wihlidal
#lockdown michal.valient

#ROBOMERGE-OWNER: simon.tourangeau
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15967887 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15988175 by simon tourangeau in ue5-main branch]
2021-04-13 08:27:58 -04:00
rune stubbe
fd94aaca5a Fixed crash when there are too many shadow casting point lights in a scene.
Nanite now automatically splits depth-only rendering into multiple passes when there are more than MAX_VIEWS_PER_CULL_RASTERIZE_PASS views.
Changed MarkPhysicalPagesRendered to 2d dispatch to get around GRHIMaxDispatchThreadGroupsPerDimension limits.

#jira UE-108354
#rb andrew.lauritzen
#lockdown michal.valient

#ROBOMERGE-SOURCE: CL 15944494 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v787-15839533)

[CL 15948916 by rune stubbe in ue5-main branch]
2021-04-07 20:58:06 -04:00
brandon schaefer
03f9db547d Fix assert on startup
#jira UE-112911
#rb Andrew.Lauritzen
#lockdown cristina.riveron

#ROBOMERGE-SOURCE: CL 15931368 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15931406 by brandon schaefer in ue5-main branch]
2021-04-06 11:48:53 -04:00
zach bethel
9fc8b1722d Refactored RDG ConvertToUntrackedX functionality into the RDG builder; renamed the operation to 'FinalizeAccess' for clarity, as the resource is considered finalized in the graph and will not transition to any other state. This operation now supports multiple resources, improving performance in cases where multiple resources are finalized back-to-back. Added validation to check that the user don't attempt to use it outside of its finalized state. Fixed up a few places where this assumption was being violated. Minor refactors in various places to use new API.
#rb arne.schober, christopher.waters
#jira none

[CL 15931331 by zach bethel in ue5-main branch]
2021-04-06 11:45:09 -04:00
charles derousiers
e13a7edf29 Add cluster shadring permutation for applying hair shadow on top of opaque geometries.
#rb none
#jira none
[FYI] andrew.lauritzen

#ROBOMERGE-SOURCE: CL 15846760 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15846763 by charles derousiers in ue5-main branch]
2021-03-28 14:38:43 -04:00
andrew lauritzen
b3d0079200 Better naming for different HZBs.
Clean up VSM HZB by moving to previous frame data and removing redundantly exported previous frame page table.
For view contexts with VSM caching "show flag" disabled, also disable HZB so we aren't leaking HZB references out of these graphs either.

#rb graham.wihlidal
[FYI] brian.karis

#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15826082 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v785-15821902)
#ROBOMERGE-CONFLICT from-shelf

[CL 15833868 by andrew lauritzen in ue5-main branch]
2021-03-25 18:19:54 -04:00
brian karis
d4981a121b Cubemap VSM no longer draws NumFaces^2 instances.
#rb ola.olsson

#ROBOMERGE-SOURCE: CL 15785126 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)

[CL 15790690 by brian karis in ue5-main branch]
2021-03-23 22:41:18 -04:00
andrew lauritzen
2e95eb31b4 Add cvar for resizing the virtual shadow map physical page pool
Refactoring to clean up some cross-frame resource references and enable more explicit allocations if needed
Allow nanite to take an external depth buffer to write to instead of creating one internally.

#rb ola.olsson

#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15781280 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v783-15756269)
#ROBOMERGE-CONFLICT from-shelf

[CL 15789787 by andrew lauritzen in ue5-main branch]
2021-03-23 21:23:57 -04:00
Guillaume Abadie
5ebd677973 Replaces SHADER_PARAMETER_RDG_BUFFER() with RDG_BUFFER_ACCESS() in nanite
#rb none
#fyi graham.wihlidal
#robomerge Release-5.0-EarlyAccess

[CL 15718938 by Guillaume Abadie in ue5-main branch]
2021-03-17 05:55:03 -04:00
andrew lauritzen
92b07781d7 Always use compute shader for VSM projection
- Adaptive ray counts for SMRT now work even with pass per light
- Removes a few divergences between the logic in the two paths

Remove debug projection stuff for now; will reimplement with a separate UAV write later

Remove temporal filtering for denoiser (it was broken and would need to be implemented slightly differently with the new path anyways)

Split cvar to allow separate denoiser toggle for directional (default on) and local (default off) lights

Enable SMRT for local lights and VSM caching by default

#rb brian.karis

#ROBOMERGE-OWNER: andrew.lauritzen
#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 15707229 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v781-15675533)
#ROBOMERGE-CONFLICT from-shelf

[CL 15708180 by andrew lauritzen in ue5-main branch]
2021-03-15 22:06:28 -04:00