Commit Graph

361 Commits

Author SHA1 Message Date
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
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