Commit Graph

60 Commits

Author SHA1 Message Date
jason hoerner
af48ea5a98 UE5_MAIN: Multi-view-family scene renderer refactor, part 2. Move FSceneTextures singleton out of RDG blackboard and FSceneTexturesConfig global variable singleton, into FViewFamilyInfo. This is necessary to allow multiple view families to render in a single render graph and a single scene renderer call.
* Existing calls to CreateSceneTextureShaderParameters and similar functions use "GetSceneTexturesChecked", which allows for the possibility that they are reached in a code path where scene textures haven't been initialized, and nullptr is returned instead of asserting.  The shader parameter setup functions then fill in dummy defaults for that case.  The goal was to precisely match the original behavior, which queried the RDG blackboard, and gracefully handled null if scene textures weren't there.  This definitely appears to occur in FNiagaraGpuComputeDispatch::ProcessPendingTicksFlush, which can be called with a dummy scene with no scene textures.  In the future, I may change this so dummy defaults are filled in for FSceneTextures at construction time, so the structure is never in an uninitialized state, but I would like to set up a test case for the Niagara code path before doing that, and the checks aren't harmful in the meantime.
* I marked as deprecated global functions which query values from FSceneTexturesConfig, but they'll still work with the caveat that if you use multi-view-family rendering, the results will be indeterminate (whatever view family rendered last).  There was only one case outside the scene renderer that accessed the globals (depth clear value), which I removed, noting that there is nowhere in the code where we modify the depth clear value from its global default.  I would like to permanently deprecate or remove these at some point.  Display Cluster is the only code that's currently using the multi-view-family code path, and as a new (still incomplete) feature, third party code can't be using it, and won't be affected.

#jira NONE
#rb chris.kulla zach.bethel mihnea.balta
#preflight 6261aca76119a1a496bd2644

[CL 19873983 by jason hoerner in ue5-main branch]
2022-04-22 17:33:02 -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
zach bethel
a00b40ad3b Deprecated GetRenderTargetItem() from IPooledRenderTarget.
#preflight 624ddb30090236773a1a83e0
#rb luke.thatcher

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 19655641 via CL 19655653 via CL 19655661
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19657582 by zach bethel in ue5-main branch]
2022-04-06 18:24:24 -04:00
tiago costa
8db233a24e Fix DFAO ghosting in mesh preview.
- By default mesh preview doesn't update in real time so temporal ghosting doesn't clear.
- Don't use temporal history when View.Family->bRealtimeUpdate == false.
- This matches what other techniques such as TAA and Motion Blur do.

#jira UE-113515
#rb Krzysztof.Narkowicz
#preflight 620d5b5b8a1ea160098312ca
#lockdown Juan.Canada

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 19068115 in //UE5/Release-5.0/... via CL 19087974
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19127325 by tiago costa in ue5-main branch]
2022-02-24 17:19:43 -05:00
tiago costa
1121428909 Refactor remaining DF shaders to use RDG - Part 2
- Convert FDFAOUpsampleParameters to SHADER_PARAMETER_STRUCT.
    - Added DistanceField::SetupAOUpsampleParameters helper function to perform the necessary logic.
- Convert FGeometryAwareUpsampleParameters to SHADER_PARAMETER_STRUCT.
    - Added SetupGeometryAwareUpsampleParameters helper function to perform the necessary logic.
- Updated TFilterHistoryPS to use SHADER_PERMUTATION_BOOL.
- Removed all legacy shader parameters from FUpdateHistoryDepthRejectionPS, FFilterHistoryPS, FGeometryAwareUpsamplePS, FDistanceFieldAOUpsamplePS.

#preflight 61b27e60d735d7945298a45f
#rb daniel.wright

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18426257 in //UE5/Release-5.0/... via CL 18426282
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18426292 by tiago costa in ue5-release-engine-test branch]
2021-12-09 17:53:21 -05:00
tiago costa
b1de4538c2 Refactor remaining DF shaders to use RDG - Part 1
- Convert FAOParameters to SHADER_PARAMETER_STRUCT.
- Added DistanceField::SetupAOShaderParameters helper function to perform the necessary logic.
- Removed all legacy shader parameters from FComputeDistanceFieldNormalPS, FComputeDistanceFieldNormalCS, FBuildTileConesCS, FObjectCullVS, FObjectCullPS
- Use FComputeShaderUtils::AddPass for the compute shaders listed above.

#preflight 61b0e21fb12ed60581b08372
#rb daniel.wright, sebastien.hillaire

#ROBOMERGE-AUTHOR: tiago.costa
#ROBOMERGE-SOURCE: CL 18417142 in //UE5/Release-5.0/... via CL 18417143
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18417145 by tiago costa in ue5-release-engine-test branch]
2021-12-09 04:49:36 -05:00
Marc Audy
0c3be2b6ad Merge Release-Engine-Staging to Test @ CL# 18240298
[CL 18241953 by Marc Audy in ue5-release-engine-test branch]
2021-11-18 14:37:34 -05:00
andrew davidson
57beb335f2 Merging //UE5/Dev-LargeWorldCoordinates [at] 17581892 to //UE5/Main
#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 17595295 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v871-17566257)

[CL 17595306 by andrew davidson in ue5-release-engine-test branch]
2021-09-22 10:01:48 -04:00
christopher waters
6c4b4a91a4 Adding a required StencilRef argument to SetGraphicsPipelineState.
#jira none
#rb zach.bethel, mihnea.balta, florin.pascu
#preflight 61312f4a79ce170001d4a79e

#ROBOMERGE-SOURCE: CL 17422777 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v865-17346139)
#ROBOMERGE[bot1]: emt

[CL 17422941 by christopher waters in ue5-release-engine-test branch]
2021-09-03 12:04:52 -04:00
zach bethel
a44fbef833 Incremental fix-up to add names to RDG passes and use the correct RHI command list.
#rb christopher.waters

#ROBOMERGE-SOURCE: CL 16923748 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16923764 by zach bethel in ue5-release-engine-test branch]
2021-07-22 11:00:18 -04:00
zach bethel
5ec769f91e RDG Parallel Execution (disabled by default)
- Refactored RDG to support free-threaded execution of passes.
 - Refactored renderer to use specific RHI command list variants in pass lambda. Immediate command list passes are forced to stay on the render thread, while other variants can be parallelized.

#rb christopher.waters

#ROBOMERGE-SOURCE: CL 16838717 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16838724 by zach bethel in ue5-release-engine-test branch]
2021-07-13 12:38:37 -04:00
krzysztof narkowicz
bb54d82bdd Distance fields:
* Added r.DistanceFields.SupportEvenIfHardwareRayTracingSupported to allow to skip DF scene creation and DF streaming if HWRT is supported. Should be really a run-time switch, but it's something for later. By default set to 1 and everything works as before
* Added ShouldCompileDistanceFieldShaders to share shader compilation conditions between all DF shaders

#rb Patrick.Kelly
[FYI] Patrick.Kelly, Daniel.Wright, Tiago.Costa

#ROBOMERGE-SOURCE: CL 16825135 via CL 16825147
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v836-16769935)

[CL 16825153 by krzysztof narkowicz in ue5-release-engine-test branch]
2021-07-12 10:24:46 -04:00
tiago costa
b934120b5e Fix crash accessing View.ViewState in DFAO.
Fallback to temporal sample index 0  when there is no view state.

#jira UE-118418
#rb juan.canada

#ROBOMERGE-SOURCE: CL 16705663 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16705669 by tiago costa in ue5-release-engine-test branch]
2021-06-17 11:52:52 -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
zach bethel
1219c611c8 Removed FRDGTexture::GetPooledRenderTarget() usage and deprecated in prepration for transient allocator support.
#rb kenzo.terelst

[CL 15628262 by zach bethel in ue5-main branch]
2021-03-05 15:28:03 -04:00
zach bethel
c6cb1e82be Deprecated and gutted FSceneRenderTargets. Moved all textures over to FSceneTextures. Refactored the renderer to use RDG textures from FSceneTextures instead.
#rb arne.schober, luke.thatcher, christopher.waters, kenzo.terelst

[CL 15040082 by zach bethel in ue5-main branch]
2021-01-11 14:49:16 -04:00
Daniel Wright
cd2c29586a Converted DistanceFieldShadows to RDG resources and pass parameters
[CL 14637331 by Daniel Wright in ue5-main branch]
2020-11-02 18:16:17 -04:00
zach bethel
e4f467569d Removed scene render target context snapshot system.
#rb arne.schober

[CL 14615156 by zach bethel in ue5-main branch]
2020-10-29 16:32:16 -04:00
zach bethel
05d33be488 Removal of the deprecated rendering composition graph from the engine.
#rb christopher.waters
#fyi charles.derousiers, steve.smith
#jira none

[CL 14523947 by zach bethel in ue5-main branch]
2020-10-20 11:36:46 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00
Marc Audy
11f5b21210 Merging //UE5/Release-Engine-Staging @ 13752110 to Main (//UE5/Main)
#rnx

[CL 13753156 by Marc Audy in ue5-main branch]
2020-06-23 18:40:00 -04:00
Josh Adams
aa9705149b Copying Private-LoadTimes-4.24 stream to Main. Biggest changes are in Materials/Shader memory freezing.
#rb none

[CL 11282608 by Josh Adams in Main branch]
2020-02-06 13:13:41 -05:00
ryan durand
0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00
Rolando Caloca
1a30325d6f Copying //UE4/Dev-RenderPlat-Staging@9551419 to //UE4/Main
#rb none
#rnx

[CL 9551447 by Rolando Caloca in Main branch]
2019-10-11 15:33:31 -04:00
Rolando Caloca
f83ae4807a Copying //UE4/Dev-Rendering@9317594 to Dev-RenderPlat-Staging
#rb none
#rnx

[CL 9317904 by Rolando Caloca in Dev-RenderPlat-Staging branch]
2019-10-01 13:03:04 -04:00