Commit Graph

50 Commits

Author SHA1 Message Date
jamie hayes
0e1478025d - Don't output velocity for WPO-enabled Nanite clusters when emitting depth with velocity output enabled.
- Split the Nanite shading pass up into two when outputting velocity during the depth pre-pass: Non-WPO & WPO.
- Add the ability to use an alternate GBuffer layout for given materials to satisfy the output bindings required by the new second Nanite shading pass.

#rb graham.wihlidal, jason.nadro
#jira UE-164554

[CL 22581659 by jamie hayes in ue5-main branch]
2022-10-17 17:59:19 -04:00
robert srinivasiah
e0fff5c260 OpenXR PixelDensity: Allow XR scene textures to use requested extents more uniformly
We previously refactored some of the code in FSceneTextureExtentState to allow for retaining VR scene textures for VR scene capture  (planar reflection) usage, assuming those scene capture extents were smaller than the 'main' VR extents.

In the previous change (12158192), there's logic where the VR extent request will 'grow' if the same VR extent is requested for multiple frames. The thinking might be to get the desired size into the history, but it's not obvious code. This 'breaks' when using a reduced PixelDensity + non-VR SceneCapture. SceneCapture will 'grow' into the bigger texture from history, which will be PD 1.0. The following usage of a sub-1.0 PD VR scene texture (with now a matching extent to the retained stereo extent) will also grow. And when it looks into the history, it will find the PD 1.0 texture, and grow into it, which wasn't the original intent.

<Resize to PD 0.5>
Frame 0 SC - Grow into PD 1.0 VR texture
Frame 0 Main Render - Use PD 0.5 size as extent because stereo history mismatch
Frame 1 SC - Grow into PD 1.0 VR texture still in history
Frame 1 Main Render - Grow into PD 1.0 VR texture because SC retained it in history

The code here has rotted from the VR perspective, and should have further updates. The original logic was meant to manage the interactions between VR main render + VR-enabled planar reflections. We need to account for all non-main render interactions. But we'll defer the bulk of risk to Main.

#jira UE-164414
#rb Arciel.Rekman
#preflight 632be803e23e50651b1ce0ce

[CL 22147123 by robert srinivasiah in ue5-main branch]
2022-09-22 18:08:17 -04:00
bryan sefcik
07894f4a07 Removed redundant private include paths from build.cs files.
Fixed include paths to be relative to the private or public folders.
Hid or removed includes that reached into other private module folders.
Updated PublicInclude paths when necessary.

#jira
#preflight 631a717cec45fbf3d74d4ba7

[CL 21916033 by bryan sefcik in ue5-main branch]
2022-09-09 00:53:22 -04:00
kenzo terelst
5cffab66a5 PSO Precache Base Changes (disabled by default)
Add PSOPrecache file which wraps engine level PSO structs and functions
- FPSOPrecacheParams used to wrap certain parameters which drive the PSO collection (mostly set from components)
- IPSOCollector interface used as engine entry to the mesh pass processors in renderer project
- FPSOCollectorCreateManager to wrap all statically registered IPSOCollector CreateFuncions
- PSOCollectorStats structs and helper functions

Add PSOPrecache support to PipelineStateCache:
- functions to precache compute and graphics PSOs
- functions to check current precache state
- FPrecacheGraphicsPipelineCache which wraps all currently precached PSOs

IMaterial entry function to PrecachePSOs with given vertex factories and params (implemented by UMaterial & UMaterialInstance) which forwards call to FMaterial and finally the FMaterialShaderMap
- FMaterialShaderMap will iterate all registered IPSOCollector to collect all possible PSOs used and forward them to the PipelineStateCache for actual (async) precaching

RHI Changes:
- Add RHI specific functions to retrieve & compare the FRHIVertexDeclaration and FGraphicsPipelineStateInitializer hash for each RHI
- Add helper functions to match RHI*State data by retrieving initializer

Minimal vertex factory changes for PSO precaching as prep - actual changes in upcoming CLs

MeshPassProcessor base functions to collect PSOs which can be used by all mesh pass processor implemention (actual changes in upcoming CLs)
- Cache complete precache data hash of stored minimal PSO so it can be used for fast actual PSO initializer hash computation (full PSO initializer is build at runtime)
- Cache if minimal PSO was successfully precache and option to skip draw when PSO is still precaching (disabled by default and doesn't work yet via GPU scene based rendering)
- Add helper functions to setup the per mesh pass render target data used during PSO collection

Refactor SceneTextureConfig so it can be initialized from an init struct and move all function to setup the internal members from SceneTexture to SceneTextureConfig using the data from the init struct (so it's available in Engine project)

Fix GBufferInfo format for velocity target (was always floating point while it should be unorm when not android

Make certain helper functions definitions to h file so they can be used everywhere (SupportsNaniteRendering, FTextureRenderTarget2DResource::GetFormat & CreateFlags)

#preflight 63189a5a967ffc68fb9044a5
#jira UE-139584
#rb Mihnea.Balta

[CL 21907508 by kenzo terelst in ue5-main branch]
2022-09-08 19:34:08 -04:00
dmitriy dyomin
dfd1f84747 Fixed: rendering issues with MSAA enabled on Android OpenGL
Make MSAA targets 'Memoryless' when possible

[CL 21500296 by dmitriy dyomin in ue5-main branch]
2022-08-22 21:36:09 -04:00
graham wihlidal
523081e351 Removed compilation (of never used!) legacy simple forward shading permutations from Windows shader databases (~27% reduction of SM6, ~22% reduction of SM5 when simple forward was enabled in the compiler)
#rb brian.karis, daniel.wright, sebastien.hillaire, charles.derousiers
[FYI] michal.valient, jason.nadro, zousar.shaker
#preflight 62c7654aa6654f9729ea9cc0

#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 21010489 via CL 21010513 via CL 21010531
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21023729 by graham wihlidal in ue5-main branch]
2022-07-09 14:02:06 -04:00
peter tarasenko
b7838e0895 Fixed crash when setting SceneRenderTargetResizeMethod higher than expected
#jira UE-156400
#rb trivial
#preflight none

[CL 20917393 by peter tarasenko in ue5-main branch]
2022-07-01 13:58:56 -04:00
robert srinivasiah
3614548d1e OpenXR: protect access to AllocateDepthTexture
Previously, we'd call AllocateDepthTexture from every SceneRenderer. Now we gate access with a bit in FSceneTexturesConfig

#jira UE-131060
#rb Arciel.Rekman
#preflight 62be5de0a3568e30668adb63

[CL 20911118 by robert srinivasiah in ue5-main branch]
2022-07-01 01:26:21 -04:00
zach bethel
c9314c30fc Moving scene texture config and parameters into the engine library.
#preflight 62b2698cda272a658f705436
#rb kenzo.terelst

[CL 20775117 by zach bethel in ue5-main branch]
2022-06-22 11:27:45 -04:00
Wei Liu
4859a28a6d Fix a bug that the MSAA is broken on android.
Clean obsolete codes in mobile postprocess.

#jira UE-156188

#rb Dmitriy.Dyomin
#preflight 62b274f08e5ee14ea77b8d10

[CL 20769595 by Wei Liu in ue5-main branch]
2022-06-21 21:54:03 -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
Wei Liu
355707489e Refactor of mobile custom depth/stencil to line up with pc on all mobile platform.
#jira none

#rb Dmitriy.Dyomin
#fyi Serge.Bernier
#preflight 627b87a65d003338d95018bf

[CL 20135905 by Wei Liu in ue5-main branch]
2022-05-11 06:10:52 -04:00
dmitriy dyomin
8cf7063946 Fixed: Rendering artifacts on a specific mobile devices with deferred shading enabled
#preflight 626220c2a21b7543713ad4f9
#jira UE-149924
#rb wei.liu
#lockdown Jack.Porter

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19898473 in //UE5/Release-5.0/... via CL 19898534
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v940-19807014)

[CL 19901837 by dmitriy dyomin in ue5-main branch]
2022-04-25 10:01:40 -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
Jeff Fisher
e8aef6706a bIsStandaloneStereoOnlyDevice thread safety ensures
-SceneTextures.cpp was using module lookup functions in the render thread that are only safe to use without locking on the game thread.  However we don't want to lock these every frame.  So I have added an accessor for this information to IStereoRendering.h and cached the values in the oculus HMD implementation that uses it but did not already have the value cached in the hmd.  This cached value can be safely read on any thread.
#review-19621457
#rb Jules.Blok Robert.Srinivasiah
#preflight 624f446f8a43273c43f570f7

[CL 19680731 by Jeff Fisher in ue5-main branch]
2022-04-07 18:37:45 -04:00
dmitriy dyomin
fc2e5b8300 Use a precise pixel format for SceneDepthAux when capturing scene depth on mobile
[FYI] jonathan.bard

#ROBOMERGE-AUTHOR: dmitriy.dyomin
#ROBOMERGE-SOURCE: CL 19642760 via CL 19642768 via CL 19642829 via CL 19642909 via CL 19642944
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v938-19570697)

[CL 19643135 by dmitriy dyomin in ue5-main branch]
2022-04-06 01:46:34 -04:00
Arciel Rekman
ac58a74d1c Fix too dark mobile preview (UE-145593)
- Contributed by Remi Palandri.

#rb Rob.Srinivasiah, JNM
#review @Robert.Srinivasiah, @Jeannoe.Morissette
#jira UE-145593
#preflight 62438ad8f4217035fa731436

[CL 19551308 by Arciel Rekman in ue5-main branch]
2022-03-29 19:15:38 -04:00
brian white
4e3f007f63 Reorganize flow to prevent calls to IHeadMountedDisplayModule::IsAvailable when not necessary.
#jira UE-143436
#rb Dmitriy.Dyomin
#preflight 622a1e2f6c2b449433c6fc0d
#rnx

[CL 19390886 by brian white in ue5-main branch]
2022-03-15 14:53:35 -04:00
dave barrett
db9bc35abc fix issue with forward rendering + MSAA on console platforms
#jira UE-138270
#preflight 61f998049e4d23cd93ae7523
#rb christopher.waters

#ROBOMERGE-AUTHOR: dave.barrett
#ROBOMERGE-SOURCE: CL 18819975 in //UE5/Release-5.0/... via CL 18819984 via CL 18822907
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18825058 by dave barrett in ue5-main branch]
2022-02-02 08:19:22 -05:00
serge bernier
9bd5dd217f Make the fetching of the Stencil/depth in the PostProcessMaterial datadriven instead of just testing the feature level. This enable some consoles using the mobile renderer to still have the possibility to use the HiStencil and fetch directly the stencil buffer in the shader.
#jira UE-139942#rb
#rb florin.pascu

#preflight Main

#ROBOMERGE-OWNER: serge.bernier
#ROBOMERGE-AUTHOR: serge.bernier
#ROBOMERGE-SOURCE: CL 18795109 via CL 18795681 via CL 18795876 via CL 18801655 via CL 18802214
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v908-18788545)
#ROBOMERGE-CONFLICT from-shelf

[CL 18808079 by serge bernier in ue5-main branch]
2022-02-01 09:47:39 -05:00
zach bethel
8c6ea80834 Relaxed validation on transient resource pool shutdown due to non-deterministic static initialization order.
#preflight 61e1d2de00246899a94c26c5
#jira UE-138871

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

[CL 18623564 by zach bethel in ue5-main branch]
2022-01-14 16:28:58 -05:00
UnrealBot
c47e81b2cb Branch snapshot for CL 18531810
[CL 18531810 in ue5-main branch]
2022-01-06 16:44:09 +00:00
UnrealBot
2987349d36 Branch snapshot for CL 18514113
[CL 18514113 in ue5-main branch]
2022-01-05 20:41:17 +00:00
zach bethel
3311c80808 Allow custom depth and depth to be transient when extracted for Slate.
#rb none
#preflight trivial

[CL 18520348 by zach bethel in ue5-main branch]
2022-01-05 12:09:12 -05:00
sebastien hillaire
f8e0092b8b New start material buffer: 2 uint using rop and the rest is written through UAV.
Huge optimisation for console.

#rb charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18309039 in //UE5/Release-5.0/... via CL 18309083
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18309131 by sebastien hillaire in ue5-release-engine-test branch]
2021-11-29 09:31:58 -05:00