Commit Graph

257 Commits

Author SHA1 Message Date
Charles deRousiers
6e019d0faf Reverse strata tile scheduling from complex to simple in order to have long wave earlier when rendering lighting.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 6273fd2e2e58cb727df35672

[CL 20059820 by Charles deRousiers in ue5-main branch]
2022-05-05 12:55:45 -04:00
yuriy odonnell
e9a5a4dd6c Fix crash when forcing all ray tracing effects off via r.RayTracing.ForceAllRayTracingEffects=0 while a scene contains a light with RT shadows
Setting ForceAllRayTracingEffects=0 is expected to work as if all ray tracing effects (including r.RayTracing.Shadows) were set to 0 and none of the lights should use ray tracing.

When ray tracing pipeline is being initialized in FDeferredShadingSceneRenderer::SetupRayTracingPipelineStates(), the required ray generation shaders are not added by PrepareRayTracingShadows() because it only checks the global RT shadow setting, but not per-light override. This can lead to ray tracing pipeline not getting initialized because the code believes that there are no active RT effects, which leads to a crash later during light rendering.

This change makes the per-light RT shadow state determination respect the global override.

#rb ...
#jira UE-150546
#preflight 626ae72ea5009ff191c484e3

#ROBOMERGE-AUTHOR: yuriy.odonnell
#ROBOMERGE-SOURCE: CL 19969043 in //UE5/Release-5.0/... via CL 19970708
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690)

[CL 19973323 by yuriy odonnell in ue5-main branch]
2022-04-28 19:35:16 -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
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
christopher waters
31658ac660 Renderer dependency cleanup focused on removing RenderGraph.h from SceneRenderTargetParameters.h
#jira none
#rb zach.bethel
#preflight 62573bf61543022eed4bc2aa

[CL 19746250 by christopher waters in ue5-main branch]
2022-04-13 17:33:48 -04:00
Arciel Rekman
700c39e0e7 Fix VSM debug view being the same for the right eye.
#rb Andrew.Lauritzen
#review @Andrew.Lauritzen, @Robert.Srinivasiah, @Jules.Blok
#jira none
#preflight 625642c45f20a0a34d8fbaf7

[CL 19734289 by Arciel Rekman in ue5-main branch]
2022-04-12 23:44:41 -04:00
Charles deRousiers
61cf50b66f Change Strata binding buffer function args to take view instead of the explicit scene data.
#rb none
#jira none
#preflight 6246ee2a292f228e0914eed2
#fyi sebastien.hillaire

[CL 19586823 by Charles deRousiers in ue5-main branch]
2022-04-01 08:35:55 -04:00
Sebastien Hillaire
1ffe7c958d Strata - Refactored indirect dispatches to source from the same indierect draw buffer, thus avoiding hitting out of uav slots on dx11.
#rb none
#preflight https://horde.devtools.epicgames.com/job/6230946ce65a7e65d6855346
#fyi charles.derousiers

[CL 19384753 by Sebastien Hillaire in ue5-main branch]
2022-03-15 09:55:16 -04:00
Sebastien Hillaire
d28a031400 Strata - beginning of rough refraction of sub layers (with scene lighting split into untouched, sss and rough reffracted luminance)
- separate SSS, opaque rough refraction and scene color output when strata project setting is enabled.
- simple placeholder per pixel variance from roughness/layers computation
- SSS only reads from subsurface buffer when ORR is enabled
- Added simple combine pass to final scene lighting (no blur for now)
- Started adding tiling but reached UAV count limit. I will refactor code later to workaround that.
- Updated light rendering, reflection environment pixel shader. Next will be lumen and clustered deferred shading.

#preflight https://horde.devtools.epicgames.com/job/622fc09fe348fe2ada4214f8
#rb none
#fyi charles.derousiers, tiantian.xie

[CL 19382940 by Sebastien Hillaire in ue5-main branch]
2022-03-15 03:11:08 -04:00
alejandro arango
51febb2897 RayTracing: Fixed how allowance per view check is made.
There was a crash that could happen when a view had ray tracing disallowed and then forcing all ray tracing effects. This was happening because part of the code thought there were not supposed to be any RT passes and would not add a given shader, but then when the effect was prepared and didn't have an associated view to query its RT allowance then it would later assert when looking for the associated shader.

#rb juan.canada
#jira UE-143796
#preflight 62181cc819758119df40e485

#ROBOMERGE-AUTHOR: alejandro.arango
#ROBOMERGE-SOURCE: CL 19149250 in //UE5/Release-5.0/... via CL 19149827
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19160966 by alejandro arango in ue5-main branch]
2022-02-25 19:30:32 -05:00
Charles deRousiers
a02d41c4ee Renamed PROJECT_STRATA into STRATA_ENABLED.
This avoids to define STRATA_ENABLED as 'env. define' for all global shaders needing a Strata specific path.

#rb none
#jira none
#fyi sebastien.hillaire
#preflight 62151b25797dbbeb472ae2eb

[CL 19074999 by Charles deRousiers in ue5-main branch]
2022-02-22 12:35:58 -05:00
Charles deRousiers
ba09fbba1a Fix strata complex tile during local light pass.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 620631789536a6024fdc00ee

[CL 18950224 by Charles deRousiers in ue5-main branch]
2022-02-11 05:05:02 -05:00
Charles deRousiers
8e6616ec01 Clean up strata tile binding.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 6204d71a8e53010a1891f7f5

[CL 18933299 by Charles deRousiers in ue5-main branch]
2022-02-10 04:16:37 -05:00
Charles deRousiers
1417ee39cc Add support Strata classification for simple lights.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 6203aa938a5584522c945abc

[CL 18916169 by Charles deRousiers in ue5-main branch]
2022-02-09 06:58:22 -05:00
Charles deRousiers
39ab1a3b59 Clean rect. light atlas invalid texture slot value.
#rb none
#jira none
#preflight 6200e4e36f05911039b192a5

[CL 18883546 by Charles deRousiers in ue5-main branch]
2022-02-07 04:34:30 -05:00
Charles deRousiers
86ece99784 Add rect light texture atlas support.
This changes allow to bind a larger amount of rect. light texture, and allows future support for rect light in forward & cluster passes.

#jira none
#rb sebastien.hillaire
#preflight 61fcebd0b5092d45ad110db4

[CL 18861192 by Charles deRousiers in ue5-main branch]
2022-02-04 04:18:10 -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
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
ben ingram
d1124c2e41 Move a bunch of lighting calculations to translated world space, fixes various problems at LWC scale
#preflight 61f1760afd5285142b43178a
#rb Daniel.Wright, tiago.costa, Andrew.Lauritzen, charles.derousiers
#jira UE-139831

#ROBOMERGE-AUTHOR: ben.ingram
#ROBOMERGE-SOURCE: CL 18738670 in //UE5/Release-5.0/... via CL 18738820 via CL 18739464
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v903-18687472)

[CL 18740039 by ben ingram in ue5-main branch]
2022-01-26 13:56:31 -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
sebastien hillaire
42f59ed615 Strata - Fixed broken categorisation
- single materials were tagged as simple
- complex material were writting pixels full screen to to read and ref being 0x0.
Fixes weird colors on some materials.
#rb none
#preflight https://horde.devtools.epicgames.com/job/61d5bd68c73b7e46b26835f5
[FYI] charles.derousiers

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18519525 in //UE5/Release-5.0/... via CL 18519531
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18519550 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-05 11:01:19 -05:00
sebastien hillaire
8f32342bf4 Made more code common with default LightCloudTransmittance structure.
Code clean up.

#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/61a7585a6c7d8a7295fcd5cc

#ROBOMERGE-AUTHOR: sebastien.hillaire
#ROBOMERGE-SOURCE: CL 18500792 in //UE5/Release-5.0/... via CL 18500812
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v899-18417669)

[CL 18500821 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-03 09:45:24 -05:00