Commit Graph

353 Commits

Author SHA1 Message Date
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
andrew lauritzen
c79193c915 Many LWC fixes for virtual shadow maaps:
- Shadow PreViewTranslation and ClipmapOrigin become full LWC tile/offset values on the GPU
- In most cases, the camera's and shadow's PreViewTranslations can be subtracted on the GPU to produce a regular-range value to transform from PrimaryView.TranslatedWorld to ShadowView.TranslatedWorld
- Miner cleanup and improvements to SMRT trace loop
- Remove special case for ortho matrices disabling PreViewTranslation in FViewMatrices
- Remove broken static function local and associated cvar r.PreViewTranslation

#preflight 6205dd571404d0fef964d721
#jira UE-139824
#rb graham.wihlidal
#lockdown juan.canada

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 18956693 in //UE5/Release-5.0/... via CL 18956877 via CL 18957087
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18958948 by andrew lauritzen in ue5-main branch]
2022-02-11 14:57:27 -05:00
ola olsson
1e2e7de5aa Fix missing VSM invalidations (where the primitive transform is not updated, but e.g., a skinned mesh is animating)
- Add bHasDeformableMesh to FPrimitiSceneProxy to declare if the meshes are deformed, e.g., skeletal mesh, to be able to catch this case.
- also fix incorrect tracking of revealed primitives (causes invalidation errors with missing shadows when meshes are culled on the CPU).
- Add cvar switch to turn off the new behavior (for emergency use) r.Shadow.Virtual.Cache.DeformableMeshesInvalidate (defaults to 1)

#jira UE-133211
#rb andrew.lauritzen
#preflight 620389584c05b86e6d60185a
#lockdown juan.canada

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18915487 in //UE5/Release-5.0/... via CL 18920329 via CL 18922688
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v916-18915374)

[CL 18923422 by ola olsson in ue5-main branch]
2022-02-09 15:11:16 -05:00
ola olsson
dce8b01085 Fix nanite not being included in CSMs in Nanite-only scenes
#jira UE-141325
#rb graham.wihlidal
#preflight 6202388b7e40979d33a153fe

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18900667 in //UE5/Release-5.0/... via CL 18900768 via CL 18900846
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18900855 by ola olsson in ue5-main branch]
2022-02-08 07:13:38 -05:00
fred kimberley
7fbfaf57c8 Require explicit constructors/casts when converting between FVector, FVector3d, and FVector3f.
#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]
2022-02-02 07:59:31 -05:00
ola olsson
9baac8f536 Double default range for movable directional light shadows (from 200m to 400m) and turn on DF shadows beyond that by default + some changed VSM config.
- add engine relese version & handling in serialization to retain default values for content saved with previous versions.
- set VSM to use distance culling for non nanite by default (r.Shadow.Virtual.UseFarShadowCulling).

#rb Francis.Hurteau,Andrew.Lauritzen,Devin.Doucette
#preflight 61f98b7da676d67c36af1589

#ROBOMERGE-OWNER: ola.olsson
#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18813152 in //UE5/Release-5.0/... via CL 18813216 via CL 18822749
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)
#ROBOMERGE-CONFLICT from-shelf

[CL 18824276 by ola olsson in ue5-main branch]
2022-02-02 07:33:10 -05:00
zach bethel
9996233f7a Removed unused legacy MSAA multi-texture support from IPooledRenderTarget.
- 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]
2022-01-31 17:22:31 -05:00
ola olsson
b5219b04e6 Remove Geometry Shader path for point-light shadow rendering, disable point light shadows if VertexShaderLayer is not supported (at runtime).
- Add r.Shadow.DetectVertexShaderLayerAtRuntime to make it possible to force (for DX11/12/SM5/Vulkan) compilation of vslayer despite RHISupportsVertexShaderLayer being false.
- Set r.Shadow.DetectVertexShaderLayerAtRuntime in WindowsEngine.ini,WinGDKEngine.ini & LinuxEngine.ini.
- Add DoesRuntimeSupportOnePassPointLightShadows to determine support at runtime.
- Fix bug excluding Nanite meshes from DF shadows for local lights if VSM is enabled (now only affects directional lights).
- Add OnGetOnScreenMessages to enable modular generation of on-screen messages in the scene renderer (aimed at transient rendering processes).

#rb arciel.rekman,andrew.lauritzen
#jira UE-138933
#preflight 61f3c967da54035207f6e560

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18769670 in //UE5/Release-5.0/... via CL 18769671 via CL 18769765
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18769767 by ola olsson in ue5-main branch]
2022-01-28 06:36:41 -05:00
andrew davidson
3542cab338 FMatrix explicit cast fixes - Renderer
#rb ben.ingram, zak.middleton
#preflight 61f285e71e5d78c38307cda4

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18752245 in //UE5/Release-5.0/... via CL 18752267 via CL 18752335
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18752338 by andrew davidson in ue5-main branch]
2022-01-27 07:20:20 -05:00
zak middleton
36c99f6887 #ue5 - LWC: FVector4f <-> FVector4d conversion is now explicit.
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]
2022-01-27 03:30:41 -05:00
jamie hayes
e4bae00099 Add opt-in ability for instanced draw calls to preserve their draw order with GPU Scene after culling.
Requires two additional compute passes post-culling to compact the draw command instances.
This feature is not currently supported on mobile platforms; more work is required to make instance compaction work with mobile vertex buffers.
Updated ISM to use order preservation for meshes that render with a translucent material

#rb ola.olsson, dmitriy.dyomin
#jira none
#preflight 61e98458c92021e535994cd7

#ROBOMERGE-AUTHOR: jamie.hayes
#ROBOMERGE-SOURCE: CL 18676076 in //UE5/Release-5.0/... via CL 18676089 via CL 18676097
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v902-18672795)

[CL 18679861 by jamie hayes in ue5-main branch]
2022-01-20 15:29:06 -05:00
ben ingram
7ae8e132e7 Allow FBoxSphereBounds to use different types for position/extent
FPrimitiveSceneInfoCompact uses float extent for bounds
#jira UE-137200
#rb andrew.davidson
#preflight 61e899e28022cea656998dc0

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18669012 in //UE5/Release-5.0/... via CL 18669053 via CL 18669074
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v901-18665521)

[CL 18669106 by ben ingram in ue5-main branch]
2022-01-19 18:58:21 -05:00
ola olsson
5d9aa916c8 Add tracking of culled prims for cached VSM, to correctly and efficiently invalidate primitives that move (even if they are culled)
- Disable view-dependent CPU culling of primitives for local-light VSMs (to fix incorrect caching).
- Track per-light cache data for clipmaps to enable storing bit flags for rendered primitives.
- Make invalidations skip primitives that were never rendered into a clipmap, and mark invalidated primitives as not rendered.

#rb andrew.lauritzen
#preflight 61e6c37b3778a195deabfb8a

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18639158 in //UE5/Release-5.0/... via CL 18639165 via CL 18639180
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18639190 by ola olsson in ue5-main branch]
2022-01-18 08:51:35 -05:00
zach bethel
0143cb41fa Deprecated defunct legacy transient resource API and removed vestiges.
#preflight 61e0a87c250b9537f7837e74
#rb christopher.waters

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 18607884 in //UE5/Release-5.0/... via CL 18607913 via CL 18607948
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v899-18417669)

[CL 18607982 by zach bethel in ue5-main branch]
2022-01-13 17:56:22 -05:00
jules blok
732e637f62 Fix renderer issues when rendering multiple ISR passes.
- New functions are added to get the Primary View or all Secondary Views and takes advantage of that to replace hardcoded indices.
- Added support for retrieving a monoscopic projection/pose from IStereoRendering when a single frustum is needed for culling purposes.

#rb Steve.Smith
#rb Jeff.Fisher
#rb Zach.Bethel
#preflight 61de16e96a076ddb53cf59b4

#ROBOMERGE-AUTHOR: jules.blok
#ROBOMERGE-SOURCE: CL 18579012 in //UE5/Release-5.0/... via CL 18579021 via CL 18579025
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v899-18417669)

[CL 18579042 by jules blok in ue5-main branch]
2022-01-11 19:03:42 -05:00
tiago costa
e25d702e73 Fix DF Shadows not working for Point/Spot lights after CL 18393307.
#jira UE-137869
#rb Ola.Olsson
#preflight 61d7386c5d522c9b409d34a5

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18533755 in //UE5/Release-5.0/... via CL 18534407
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18534568 by tiago costa in ue5-release-engine-test branch]
2022-01-06 14:36:01 -05:00
ola olsson
845729c8b2 Fix bug caused by preshadows not being projected when cached after CL 18393307.
#jira UE-136934,UE-137774
#rb charles.derousiers
[FYI] andrew.lauritzen
#preflight 61d5883cd17842e547b49e5a

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18517605 in //UE5/Release-5.0/... via CL 18517606
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18517607 by ola olsson in ue5-release-engine-test branch]
2022-01-05 07:08:17 -05:00
ola olsson
d713902d26 Fix missing VSM when there is only Nanite affecting a point light by tracking if Nanite geometry was rendered into a shadow map
#rb rune.stubbe
#preflight 61b9d10e9611744de2aced42

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18466180 in //UE5/Release-5.0/... via CL 18466184
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18466185 by ola olsson in ue5-release-engine-test branch]
2021-12-15 06:38:37 -05:00
ola olsson
d57b5986e3 Propagate ActorLabel to FLightSceneProxy such that names shown in logging/profiling/diagnostics match those shown in editor
- Removed dead code that once set up additional draw event scopes
- Deprecate FLightSceneProxy::GetComponentName and direct users to GetComponentFName to make it more clear what it does
- Change ComponentName to store the component name (not the owner name)
- Change uses of FName to use FString (for reporting invalid/unbaked lights etc)
- Make ACTOR_HAS_LABELS respect WITH_PROFILEGPU to enable profiling in Test & Shipping

#rb daniel.wright,JeanFrancois.Dube
#preflight 61b0b4f0b12ed60581aadaf9

#ROBOMERGE-AUTHOR: ola.olsson
#ROBOMERGE-SOURCE: CL 18405109 in //UE5/Release-5.0/... via CL 18405116
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v896-18170469)

[CL 18405129 by ola olsson in ue5-release-engine-test branch]
2021-12-08 09:04:29 -05:00