Commit Graph

371 Commits

Author SHA1 Message Date
ola olsson
21ad39d384 Support Nanite material visibility culling for VSM, r.Shadow.Virtual.Nanite.MaterialVisibility, default off.
#preflight 636e5ae58f4cb2e4dceda7e4

[CL 23107926 by ola olsson in ue5-main branch]
2022-11-11 18:59:13 -05:00
graham wihlidal
1c86c4a042 Dynamic Nanite error heuristic (WIP)
#rb guillaume.abadie
[FYI] brian.karis, rune.stubbe, ben.woodhouse
#preflight skip

[CL 22724347 by graham wihlidal in ue5-main branch]
2022-10-24 09:18:17 -04:00
Wei Liu
2e208ee416 Invalidate CSM caching if FOV has been changed.
#jira none

#rb Ola.Olsson, Dmitriy.Dyomin
#preflight 6353558bae33b04ec1410aae

[CL 22708144 by Wei Liu in ue5-main branch]
2022-10-21 22:47:32 -04:00
ola olsson
ef16a021a7 Fixed incorrect local-light shadow occlusion culling for VSM that causes caching of empty pages.
#rb rune.stubbe
#preflight 634fc050b13bfb29ebcf5b2a

[CL 22634784 by ola olsson in ue5-main branch]
2022-10-19 15:12:48 -04:00
ola olsson
769f1abecb Disable "conservative culling" for VSM by default to reduce CPU/empty draw overhead for non-nanite geometry (host side tracking makes this not needed anymore).
#rb kevin.ortegren
#preflight 6347fa638a0a7b2adccdb82f

[CL 22507194 by ola olsson in ue5-main branch]
2022-10-13 13:01:35 -04:00
ola olsson
97954ce075 Added project setting to disable per-object translucency shadows (off by default)
#jira UE-157672
#rb Sebastien.Hillaire,Krzysztof.Narkowicz
#preflight 633ad42eef77394565fe472d

[CL 22305618 by ola olsson in ue5-main branch]
2022-10-03 11:35:41 -04:00
kenzo terelst
ee56085de5 - ComputeMeshFillMode doesn't require MeshBatch as parameter
- MeshPassProcessor create function takes feature level as create parameter
- MeshPassProcessor base stores the processor enum type (handy for reference and stat tracking per pass type)
 When pass enum value is not available then EMeshPassType::Num is used for now

#jira UE-139584
#rb Jason.Nadro, Mihnea.Balta, Zach.Bethel, Arciel.Rekman
#preflight 631b30f1304480f8f89fca35

[CL 21987972 by kenzo terelst in ue5-main branch]
2022-09-13 14:04:12 -04:00
wouter dek
2109139fc8 Use light view culling only on non-static, non-vsm shadow maps
#jira UE-143776
#preflight 6304973b5366f61a42609105
#rb ola.olsson

[CL 21537717 by wouter dek in ue5-main branch]
2022-08-24 07:58:46 -04:00
daniel wright
12f2dcb60a Experimental Lumen Direct Lighting - fast but low quality direct lighting through Lumen's Final Gather
* When r.Lumen.ScreenProbeGather.DirectLighting is enabled, all local lights will be rendered by Lumen (if enabled)
 * With 8 shadowed lights on screen, Lumen Direct Lighting costs .4ms, while Cached Shadowmaps cost (1.3ms), Distance Field Shadows are (1.8ms) and Virtual Shadow Maps (6.1ms) on a 2080 TI at 1080p resolution
 * IES profiles and Light Functions are not yet supported, nor is Hardware Ray Tracing
 * Shadowing and light attenuation resolution is tied to Screen Probe Gather downsampling so quality becomes poor with High GI settings (32x downsampling)
 * r.Lumen.ScreenProbeGather.LightSampleResolutionXY controls how many light samples are traced per Screen Probe, with lights being selected with equal probability.  More lights overlapping causes more noise, not increased GPU cost.

#ROBOMERGE-OWNER: daniel.wright
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 21213896 via CL 21214406 via CL 21214468
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21214926 by daniel wright in ue5-main branch]
2022-07-22 00:56:31 -04:00
ola olsson
89d17897c6 Added support for Distant Lights (VSM)
- Added FShadowSceneRenderer to handle shadow rendering (transient) work - intended to take over more responsibility from here on.
- Added cache invalidation when lights are removed from the FScene (required as ID / cache key may change)
- Modified caching scheme to drop cache entries when caching is disabled.
- Changed local light footprint estimation to depend on the scaled resolution (screen percentage)
- Moved light location data and test to per-light cache entry (rather than per-shadow map)

#rb andrew.lauritzen
#jira UE-122102
#preflight 62d820cb4b6d775f5fa9328a

#ROBOMERGE-OWNER: ola.olsson
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 21198820 via CL 21198827 via CL 21198864
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21199396 by ola olsson in ue5-main branch]
2022-07-21 07:46:36 -04:00
Charles deRousiers
149dc1aeb7 Fix hair strands shadow culling when hair instance is not visible in primary view.
Updated with a crash fix with DXC.

#rb none
#jira UE-117220
#preflight 62d6d3883c3df323902765a3

[CL 21174577 by Charles deRousiers in ue5-main branch]
2022-07-20 03:55:11 -04:00
Jason Nadro
55f1e0c48b [Backout] - CL21163556
#fyi Charles.deRousiers
#preflight 62d721bf47779a730ab33659
Original CL Desc
-----------------------------------------------------------------
Fix hair strands shadow culling when hair instance is not visible in primary view.

#rb none
#jira UE-117220
#preflight 62d6d3883c3df323902765a3

[CL 21167606 by Jason Nadro in ue5-main branch]
2022-07-19 17:35:22 -04:00
Charles deRousiers
0cc713e73f Fix hair strands shadow culling when hair instance is not visible in primary view.
#rb none
#jira UE-117220
#preflight 62d6d3883c3df323902765a3

[CL 21163556 by Charles deRousiers in ue5-main branch]
2022-07-19 12:09:21 -04:00
zach bethel
34623f0321 Replaced thread-local MemStack with ConcurrentLinearAllocator across the renderer.
- Removed scene render mem-mark among others. MemStack usage is now restricted to local scopes with known marks.
 - Render resources with destructors are allocated using the FSceneRenderingBulkObjectAllocator on FSceneRenderer, which is deleted when the scene render is.

#preflight 62b266e20d4d6228de97babe
#rb mihnea.balta, yuriy.odonnell

[CL 20907647 by zach bethel in ue5-main branch]
2022-06-30 19:55:24 -04:00
Richard Malo
e81527cffc Fixed WorldPartition MinimapBuilder to work with LWC.
Added CheckForErrors to detect  cases where minimap builder will either fail to generate or will generate a low quality mini-map.
#rb sebastien.lussier, jeanfrancois.dube
#jira UE-156424
#preflight 62aca0dd5c69124c40c9f51a

[CL 20704552 by Richard Malo in ue5-main branch]
2022-06-17 12:07:56 -04:00
ola olsson
dab672c8e6 Skip marking primitive as rendered in VSM if not added to any draw lists (removes invalidations from translucent, e.g., water).
#rb andrew.lauritzen
#preflight 62aa0d7d9c7b849bb577437c

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 20672592 via CL 20673031 via CL 20673399
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v955-20579017)

[CL 20675218 by ola olsson in ue5-main branch]
2022-06-15 15:11:56 -04:00
Andrew Davidson
8d844cd4a6 Improve support for an extended WORLD_MAX
#rb various, trivial
#preflight 62a1cb46f73a01bd981b9978

[CL 20573655 by Andrew Davidson in ue5-main branch]
2022-06-09 07:03:13 -04:00
jason hoerner
6144ebf450 Scene renderer no longer contains multiple view families. Instead, multiple view families are handled by creating multiple scene renderers, which are added to a linked list with the first scene renderer as the list head. This more or less reverses CL 19813996, while preserving the optimizations gained from having knowledge of multiple scene renderers. This includes deferring cross GPU resource transfer waits to the last scene render, running ray tracing scene update once, and only flushing resources once. Future optimizations and bug fixes may take advantage of additional information from other scene renderers.
The refactor to get rid of the FSceneTextures and FSceneTexturesConfig global singletons has also been preserved.  The FViewFamilyInfo is used to hold those structures, so client facing API functions that lack a scene renderer reference can still pull the FSceneTextures[Config] from the view family pointer.  All other scene renderer state has been moved from FViewFamilyInfo back into FSceneRenderer.

#jira none
#rnx
#rb ola.olsson krzysztof.narkowicz zach.bethel
#preflight 629f770e233ae0a8f8fb7f2e

[CL 20540730 by jason hoerner in ue5-main branch]
2022-06-07 13:19:54 -04:00
jason hoerner
0267d53323 DisplayCluster: Virtual Shadow Map cache can optionally be allocated per view, and enabled that feature for Virtual Production. Significant performance win by avoiding constant cache thrashing when rendering multiple families. Frame time goes from ~45 ms to ~26 ms for Valley test scene (Node 2), GPU bound in both cases. Separate cache per view isn't implemented for split screen views (single view family with multiple views), but Virtual Production doesn't use that, and support for that could be added in the future.
#jira UE-142732
#rb andrew.lauritzen ola.olsson
#preflight 628d06a45c3ef99a7b2fffa3

[CL 20351116 by jason hoerner in ue5-main branch]
2022-05-24 13:17:13 -04:00
jason hoerner
b19bb6be2f UE5_MAIN: Multi-view-family scene renderer refactor, part 1. Major structural change to allow scene renderer to accept multiple view families, with otherwise negligible changes in internal behavior.
* Added "BeginRenderingViewFamilies" render interface call that accepts multiple view families.  Original "BeginRenderingViewFamily" falls through to this.
* FSceneRenderer modified to include an array of view families, plus an active view family and the Views for that family.
* Swap ViewFamily to ActiveViewFamily.
* Swap Views array from TArray<FViewInfo> to TArrayView<FViewInfo>, including where the Views array is passed to functions.
* FSceneRenderer iterates over the view families, rendering each one at a time, as separate render graph executions.
* Some frame setup and cleanup logic outside the render graph runs once.
* Moved stateful FSceneRenderer members to FViewFamilyInfo, to preserve existing one-at-a-time view family rendering behavior.
* Display Cluster (Virtual Production) uses new API.

Next step will push everything into one render graph, which requires handling per-family external resources and cleaning up singletons (like FSceneTextures and FSceneTexturesConfig).  Once that's done, we'll be in a position to further interleave rendering, properly handle once per frame work, and solve artifacts in various systems.

#jira none
#rnx
#rb zach.bethel
#preflight 625df821b21bb49791d377c9

[CL 19813996 by jason hoerner in ue5-main branch]
2022-04-19 14:45:26 -04:00
Wei Liu
04d7580d62 Clustered local lights and reflections are supported on mobile forward and deferred.
Local light shadows are supported on mobile forward and deferred, need to enable full depth prepass to generate the ShadowMaskTexture.

Remove the 4 maximum local lights limitation on mobile forward.

Remove the "High Quality Reflection" on mobile forward.

Disable simple lights on mobile forward.

#jira UE-149064

#rb Dmitriy.Dyomin

#preflight 625d17da772cf82d3a6059a6

[CL 19784597 by Wei Liu in ue5-main branch]
2022-04-18 09:09:40 -04:00
tiago costa
e90e058b9f Fix DF Shadows when using split screen.
- Point/Spot lights use the same FProjectedShadowInfo for all views. RayTracedShadowsTexture was only generated for the first view. Other views also sampled first view data.
- Store RayTracedShadowsTexture per view in DistanceFieldShadowViewGPUData to avoid using the cached result of a different view.

#rb Sebastien.Hillaire, Jian.Ru
#preflight 624ef87e3603402d600744e1

[CL 19669626 by tiago costa in ue5-main branch]
2022-04-07 11:06:06 -04:00
andrew davidson
945ff2546b Added AWorldSettings::bEnableLargeWorlds wrapping disabling bounds checks, octree visibility, and octree shadow culling.
#jira UE-137657
#rb phillip.kavan
#lockdown julien.marchand
#preflight 621e4276ad75a7f58fc330d6

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 19201573 in //UE5/Release-5.0/... via CL 19202230
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19214945 by andrew davidson in ue5-main branch]
2022-03-01 21:08:36 -05:00
ola olsson
a0076a2ee5 Remove check that prevented per-object shadow setup to run if non-nanite VSM were active (which allows the per-object translucent shadows to work).
#jira UE-143495
#rb charles.derousiers
#preflight 621dd054313c8c01032cdfff

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 19196471 in //UE5/Release-5.0/... via CL 19196525
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19212720 by ola olsson in ue5-main branch]
2022-03-01 19:54:06 -05:00
stu mckenna
f434919867 - Fix for translucent shadows not being rendered
#rb zach.bethel
#jira UE-143495
#rnx
#preflight 621d1c22037be0078cac4447

#ROBOMERGE-AUTHOR: stu.mckenna
#ROBOMERGE-SOURCE: CL 19179993 in //UE5/Release-5.0/... via CL 19182416
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19204419 by stu mckenna in ue5-main branch]
2022-03-01 15:06:48 -05:00