Commit Graph

182 Commits

Author SHA1 Message Date
jason hoerner
11ea386451 RHI validation fix: avoid redundant RHI frame begin/end when cubemap capture occurs during UEngine::Tick, and other Tick related functions where the RHI frame will already be active. A boolean "bInsideTick" flag is passed to UReflectionCaptureComponent::UpdateReflectionCaptureContents, specifying whether the cubemap capture is happening during Tick.
The four places this applies include UEditorEngine::Tick, UGameEngine::Tick, FAdvancedPreviewScene::Tick, and FPreviewScene::UpdateCaptureContents.  The last example is called from FBlueprintEditor::Tick and FThumbnailPreviewScene::Tick.

The counter-example is "UEditorEngine::BuildReflectionCaptures", which doesn't appear to be called anywhere from a Tick related function.  It's called in startup functions, various commands, and as part of static lighting generation.  If we run into further validation errors, we could add a flag to that function to differentiate those cases.  Even though there's only one counter-example, I figured it was best to err on the side of not changing behavior of client code that may also be using the function, so by default "bInsideTick" is set to false.

#jira UE-153604
#rb mihnea.balta jason.nadro
#rnx
#preflight 628d89082f2409bc1e08a42e

[CL 20362380 by jason hoerner in ue5-main branch]
2022-05-25 07:11:28 -04:00
zach bethel
29d075c4c8 Deprecated GRHISupportsResolveCubemapFaces.
#preflight 62880985192a338d864ba496

[CL 20304268 by zach bethel in ue5-main branch]
2022-05-20 18:14:00 -04:00
zach bethel
3cc87760bd Removed cases of AddCopyToResolveTargetPass which either weren't necessary or weren't performing multisample resolves.
#preflight 628270aa046b81bf93c13e50

[CL 20226032 by zach bethel in ue5-main branch]
2022-05-16 12:09:51 -04:00
carl lloyd
49d2564572 Removed depth texture binding in CopySceneToCubeFace pass on Mobile platforms
#rb Jack.Porter
#jira UE-151325
#lockdown Mitchell.Wilson
#preflight 627b7dc10a5817c9d93cfa75

#ROBOMERGE-AUTHOR: carl.lloyd
#ROBOMERGE-SOURCE: CL 20138648 in //UE5/Release-5.0/... via CL 20140427
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 20143855 by carl lloyd in ue5-main branch]
2022-05-11 13:17:32 -04:00
Tiantian Xie
2d7f3c3317 Fix crash when building lighting with a reflection capture.
* Capture in editor(was +2) and loading from file(+1) added different reference count. The cubemap in use is not marked as delete correctly.
* When a capture is rebuilt, all reference should change to the new capture.

#jira UE-150154
#rb Juan.Canada
#preflight 626ca44eef3968f419d12513

[CL 20008692 by Tiantian Xie in ue5-main branch]
2022-05-02 10:53:51 -04:00
carl lloyd
73c8996430 Mobile GL Deferred ReflectionCapture UBO fix (passed too many elements and hit the GL limit)
#rb Zach.Bethal, Dmitriy.Dyomin
#preflight 626a69d52d28b9d0f7831abc

[CL 19957425 by carl lloyd in ue5-main branch]
2022-04-28 06:34:43 -04:00
richard wallis
3212aa1990 Fix for macOS VRTemplate project crashes when adding a const 4 in a new material.: Use Resolve scene textures in CopySceneToCubeFace() as Target can cause MSAA texture type binding issues in Metal. Part 2 of this fix has already been addressed in CL 19857000.
#jira UE-149469
[REVIEW] [at]zach.bethel,  [at]will.damon
#preflight 6266a2077e06ec7505a69deb
#lockdown Mihnea.Balta

#ROBOMERGE-AUTHOR: richard.wallis
#ROBOMERGE-SOURCE: CL 19936476 in //UE5/Release-5.0/... via CL 19936682
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19937369 by richard wallis in ue5-main branch]
2022-04-27 07:38:30 -04:00
zach bethel
10131e1285 Refactored RDG in preparation for UnifiedBuffer conversions.
- Refactord 'Finalized Access' feature into a more flexible 'External' vs. 'Internal' access mode per resource toggle.
      - Resources can transition between modes multiple times within the graph.
      - Supports async compute pipeline.
      - Supports queueing of requests to avoid back-to-back helper passes.
      - This feature is needed to support conversion of GPU scene buffers.

 - Deprecated the ReadOnly and ForceTracking resource flags and added a 'SkipTracking' flag instead.
      - Previous semantics were confusing and error prone.
      - New model requires a manual flag to tell RDG never to transition a resource.
      - This flag is used for read-only dummy resources as an optimization.

 - Renamed some of the auxiliary 'FinalizedResource' utilities since the name no longer matches the semantics.

#preflight 6266cc6d0634d0904ce4ba46

[CL 19904734 by zach bethel in ue5-main branch]
2022-04-25 13:00:12 -04:00
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
rtrick
4ecbb1ce26 PR #8520: Fix for Reflection Captures sometimes showing up black in packaged game. (Contributed by rtrick)
#ushell-cherrypick of 17834874 by UnrealBot

#jira UE-131950
#preflight 624dd34f8e5ae00f0acc7a58
#rb none

[CL 19670744 by rtrick in ue5-main branch]
2022-04-07 11:53:12 -04:00
christopher waters
cb6ce0960c Easier FRHITextureCreateDesc construction and FRHITextureDesc static CreateXXX deprecation
- Deprecated all the Create functions in FRHITextureDesc
- Added Create functions to FRDGTextureDesc which now derives from FRHITextureDesc instead of just being an alias
- FRHITextureCreateDesc can now be constructed functionally via SetXXX functions that return a reference to the FRHITextureCreateDesc
- Fixed a couple bad uses of FRHITexture*Desc types that should have been using FRDGTextureDesc

#jira none
#rb zach.bethel, luke.thatcher, mihnea.balta
#preflight 623df2e16d39f6b5a057299e

[CL 19516773 by christopher waters in ue5-main branch]
2022-03-25 14:18:22 -04:00
zach bethel
51d195d21f Major refactor of reflection capture code.
- Converted to RDG.
 - Converted mobile to use subresource transitions instead of awkward ping-ponging between render targets.
 - Merged duplicate code paths between mobile / desktop.
 - Eliminated FReflectionScratchCubemaps singleton in favor of explicit resource marshalling.

#preflight 623cdecc573f51b292c9c84a
#rb christopher.waters

[CL 19513281 by zach bethel in ue5-main branch]
2022-03-25 11:17:23 -04:00
Arciel Rekman
111627d950 Flip HMD extensions to opt-in rather than opt-out
#rb Rob.Srinivasiah, Jonathan.Bard, Jules.Blok
#review @Robert.Srinivasiah
#jira none
#preflight 6238b58f9304d833f4e65e3b

[CL 19472593 by Arciel Rekman in ue5-main branch]
2022-03-22 17:27:12 -04:00
arciel rekman
8d77b85911 Disable HMD extensions for reflection capture rendering.
#rb Rob.Srinivasiah, Jonathan.Bard, Jules.Blok
[REVIEW] [at]Robert.Srinivasiah, [at]Jonathan.Bard, [at]Jules.Blok
#jira UE-142863
#preflight 620c5ad66d2ea505c3e90684

#ROBOMERGE-AUTHOR: arciel.rekman
#ROBOMERGE-SOURCE: CL 19059799 in //UE5/Release-5.0/... via CL 19074931
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19076728 by arciel rekman in ue5-main branch]
2022-02-22 13:57:04 -05:00
jonathan bard
96f58b74b5 Made sure that view extensions are gathered and that PreRenderView_RenderThread/PreRenderViewFamily_RenderThread and SetupView/SetupViewFamily are called on all of them for all code paths triggering a scene render.
* For thumbnail renderers, the prototype of RenderViewFamily (which is called by all the types of thumbnail renderers) has been changed to take a non-const FSceneView* parameter (so that SetupView can be called on it) and the various GetView functions have been renamed CreateView since it more accurately depicts what the functions do (plus they return the non-const view they've created)
* UGameViewportClient::Draw was calling SetupViewFamily but not SetupView
* Made sure FSceneRenderer::ViewExtensionPreRender_RenderThread is called right before RenderThreadBegin for all code paths
* Made sure view extensions are gathered for all code paths rendering a view family

Note: BeginRenderViewFamily (i.e. game-thread), PostRenderView_RenderThread and PostRenderViewFamily_RenderThread are still not called on the non-standard code paths

#jira UE-140273, UE-140489, UE-139067, UE-140425
#rb sebastien.lussier, rob.srinivasiah
#tests EngineTests (screenshots), editor
#preflight 61fd216ae17efe76d1b49a2d
#lockdown mihnea.balta

#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 18884880 in //UE5/Release-5.0/... via CL 18884941 via CL 18885221
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18885607 by jonathan bard in ue5-main branch]
2022-02-07 10:11:19 -05:00
andrew davidson
cac76b118e Fix FVector2D variant casts - Renderer
Submitted on behalf of fred.kimberley
#rb andy.davidson
#preflight 61f8700e41414fb013dd4002

#ROBOMERGE-AUTHOR: andrew.davidson
#ROBOMERGE-SOURCE: CL 18801433 in //UE5/Release-5.0/... via CL 18802090 via CL 18821511
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18821594 by andrew davidson in ue5-main branch]
2022-02-02 01:43:41 -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
sebastien lussier
3d1340222f Fixed missing view extensions registration when creating view families
#jira UE-140425
#rb patrick.enfedaque, juan.canada
[FYI] jonathan.bard
#preflight 61f832a95a026d2d19b237cd

#ROBOMERGE-AUTHOR: sebastien.lussier
#ROBOMERGE-SOURCE: CL 18794281 in //UE5/Release-5.0/... via CL 18795274 via CL 18796233
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)

[CL 18796574 by sebastien lussier in ue5-main branch]
2022-01-31 15:50:46 -05:00
daniel wright
d4edb77771 Support Reflection Captures in projects with r.AllowStaticLighting=0. This allows them to be used on Medium scalability, when Lumen GI is disabled.
* ReflectionEnvironmentAndSky is now run on Reflection Captures to apply Movable skylight
 * Movable meshes and lights are now rendered into Reflection Captures when r.AllowStaticLighting=0
#preflight 61f313bc75432e9e8e64840f

#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 18767566 in //UE5/Release-5.0/... via CL 18767582 via CL 18767664
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18767678 by daniel wright in ue5-main branch]
2022-01-27 21:25:37 -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
tiantian xie
bde190cc44 Volumetric Fog results in Reflection Capture are not correct.
Add a new CVar �r.ReflectionSkyLightCapture.EnableLightFunctions� to resolve this issue.

#jira UE-137484
#rb Sebastien.Hillaire
#preflight 61eb0249731e3b40889a9819

#ROBOMERGE-AUTHOR: tiantian.xie
#ROBOMERGE-SOURCE: CL 18693023 in //UE5/Release-5.0/... via CL 18693250 via CL 18693412
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18693548 by tiantian xie in ue5-main branch]
2022-01-21 14:25:40 -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
wei liu
7c51b64197 Fix a bug that the brightness of the reflectioncapture couldn't be changed at runtime on mobile.
#jira none

#rb Dmitriy.Dyomin, Florin.Pascu
#preflight 61dcfae44455f00ccd346956

#ROBOMERGE-AUTHOR: wei.liu
#ROBOMERGE-SOURCE: CL 18571078 in //UE5/Release-5.0/... via CL 18571095
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18571097 by wei liu in ue5-release-engine-test branch]
2022-01-11 08:56:26 -05:00
jon nabozny
cdc65f654f Reland: Fixes motion blur lengths when using time dilation
#rb josie.yang
#lockdown michal.valient
#preflight 614a44526c96990001c47143

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17606608 via CL 17962735 via CL 18364937 via CL 18364960
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18365023 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:53:56 -05:00
jon nabozny
9693ad4915 Undo //UE5/Private-Frosty/Engine/... changelist 17586431
#lockdown michal.valient
#preflight revert for build breakage

#ROBOMERGE-OWNER: jon.nabozny
#ROBOMERGE-AUTHOR: guillaume.abadie
#ROBOMERGE-SOURCE: CL 17587410 via CL 17948832 via CL 18364580 via CL 18364616
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18364712 by jon nabozny in ue5-release-engine-test branch]
2021-12-02 23:34:52 -05:00