Commit Graph

298 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
Ola Olsson
fe64cb01af Add InstanceSceneDataOffset to visible/cached mesh draw commands and propagate
- Intermediate step towards making renderer instance-first.
 - Enables simplification of instance culling setup.

#rb Krzysztof.Narkowicz

[CL 16729395 by Ola Olsson in ue5-main branch]
2021-06-21 12:25:46 -04:00
Jian Ru
f16252beb2 Add an option to render distance field shadows using async compute. Also fix a bug where a raytraced DF FProjectedShadowInfo is rendered for all views instead of just its dependent view
#jira UE-114984
#rb ben.woodhouse, tiago.costa

[CL 16683751 by Jian Ru in ue5-main branch]
2021-06-15 22:28:34 -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
aurel cordonnier
e0ad4e25df Merge from Release-Engine-Test @ 16624776 to UE5/Main
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16625248 by aurel cordonnier in ue5-main branch]
2021-06-10 13:13:24 -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
aurel cordonnier
43fa62fcd8 Merge from Release-Engine-Test @ 16487383 to UE5/Main
This represents UE4/Main @ 16445039 and Dev-PerfTest @ 16444526

[CL 16488106 by aurel cordonnier in ue5-main branch]
2021-05-27 13:40:37 -04:00
Ola Olsson
df492855e0 Removed GPUCULL_TODO define (fixed in on-state)
#preflight 60acc49b58f02e0001a0a996
#rb graham.wihlidal,Arciel.Rekman,Brandon.Schaefer,will.damon

[CL 16446355 by Ola Olsson in ue5-main branch]
2021-05-25 08:15:14 -04:00
jeff newquist
f889f39cda Free FProjectedShadowInfo::ProjectionStencilingPasses in FProjectedShadowInfo destructor, else could leak if ClearTransientArrays() wasn't called.
#rb TBD
#jira UE-115105

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

[CL 16405790 by jeff newquist in ue5-main branch]
2021-05-20 13:01:52 -04:00
zach bethel
2200ccd19c Minor optimization to destruction of memstack shadows.
#fyi andrew.lauritzen

[CL 16322810 by zach bethel in ue5-main branch]
2021-05-13 20:20:36 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
Wei Liu
a0f4c7a293 Support CSM Caching.
#jira none

#rb Ola.Olsson, Dmitriy.Dyomin, Jack.Porter, Mi.Wang

[CL 16204572 by Wei Liu in ue5-main branch]
2021-05-05 04:18:08 -04:00
andrew lauritzen
968b88f36a Avoid unnecessary CPU culling of nanite meshes in shadow rendering
#rb graham.wihlidal
#lockdown michal.valient

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

[CL 15979143 by andrew lauritzen in ue5-main branch]
2021-04-12 12:47:10 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
andrew lauritzen
07c2fd9238 Treat stationary lights as movable for the purposes of shadowing when Non-Nanite VSMs are enabled.
Remove VirtualShadowMapConfig.h which is no longer necessary.

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

[CL 15921215 by andrew lauritzen in ue5-main branch]
2021-04-05 15:05:40 -04:00
jian ru
d2963a25ed Remove async LPI creation
#test compiled ue4editor; checked several levels in qagame

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

[CL 15785721 by jian ru in ue5-main branch]
2021-03-23 17:51:51 -04:00
ola olsson
c6d735addf Stereo GPU-Scene Instance culling fixes
- added explicit stereo mode to instance culling context.
- fixed the stencil setup pass parameter to include the InstancedView (lost in RDG conversion probably)
- restored the hack to run the stereo stencil pass twice (needed to make FSimpleMeshDrawCommandPass support setting up stereo)

#rb andrew.lauritzen,steve.smith
[FYI] jules.blok

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

[CL 15739606 by ola olsson in ue5-main branch]
2021-03-18 13:39:09 -04:00
andrew lauritzen
9b0a6fab9d Remove complete shadow maps and replace with direct VSM sampling
- 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]
2021-03-08 23:14:54 -04:00
Marc Audy
8f73cd7fa9 Merge UE5/Release-Engine-Staging @ 15630841 to UE5/Main
This represents UE4/Main @ 15601601

[CL 15631170 by Marc Audy in ue5-main branch]
2021-03-05 19:27:14 -04:00
ola olsson
09532969fe Added (read only) cvar r.Shadow.Virtual.NonNaniteVSM to toggle non-nanite VSM support
#rb Brian.Karis,Andrew.Lauritzen

#ROBOMERGE-SOURCE: CL 15526905 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15526909 by ola olsson in ue5-main branch]
2021-02-25 05:03:27 -04:00
will damon
0a298b5d97 Disable GPU culling on Apple and Linux platforms.
- Convert preprocessor 'defined(GPUCULL_TODO)' checks to 'GPUCULL_TODO'
- Define GPUCULL_TODO to 0 for Apple and Linux platforms

#rb rolando.caloca
[FYI] carl.lloyd brandon.schaefer ola.olsson lukas.hermanns graham.wihlidal
#jira UE-109070
#rnx

#ROBOMERGE-OWNER: will.damon
#ROBOMERGE-AUTHOR: will.damon
#ROBOMERGE-SOURCE: CL 15502801 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15503935 by will damon in ue5-main branch]
2021-02-23 15:21:24 -04:00
Florin Pascu
77051879b6 DistanceField Shadow Mobile(disabled by default for the moment)
#rb Dmitriy.Dyomin,Zach.Bethel, Jack.Porter
#jira UE-103864

[CL 15471024 by Florin Pascu in ue5-main branch]
2021-02-19 07:49:57 -04:00
graham wihlidal
200151a3bc Renamed r.Shadow.v.* cvars to r.Shadow.Virtual.* to be more obvious, and also renamed VSM.* resource prefixes to Shadow.Virtual.*
#rb brian.karis
[FYI] ola.olsson, andrew.lauritzen

#ROBOMERGE-SOURCE: CL 15450709 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15454805 by graham wihlidal in ue5-main branch]
2021-02-18 13:44:36 -04:00
ola olsson
f7822cb8c5 Enable caching for Non-Nanite VSM
- added a path to propagate and cache whether material modifies position (WPO) to enable invalidating cached pages (touches whole mesh command pipeline).
- added pixel shader verision of page copying & clearing.
- also added flag for whether cached the mesh draw command supports primitive id (which enables checing this earlier).

#rb andrew.lauritzen,brian.karis,graham.wihlidal,Krzysztof.Narkowicz

#ROBOMERGE-SOURCE: CL 15436539 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15441336 by ola olsson in ue5-main branch]
2021-02-17 15:32:52 -04:00
ola olsson
0ee0c57088 Defer ID translation for dynamic primitives such that the commit can happen at any time before draw submit.
- dynamic primitive collectors now auto-commit when uploading dynamic primitives, simplifying use.
- fixed shadow stencil passes to properly use GPU-Scene instance culling (and instancing), now using FSimpleMeshDrawCommandPass
- Also move translucency shadow rendering to FSimpleMeshDrawCommandPass

#jira UE-108032
#rb Krzysztof.Narkowicz

#ROBOMERGE-SOURCE: CL 15432971 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15441234 by ola olsson in ue5-main branch]
2021-02-17 15:31:33 -04:00