Commit Graph

177 Commits

Author SHA1 Message Date
stu mckenna
6fde3bb5fd - Add support for InverseExposureBlend to simple lights
- Niagara default is controlled inside NiagaraSettings and can be overridden per light renderer
- Cascade default setting is controlled by console variable fx.ParticleDefaultLightInverseExposureBlend and can be overridden per light module

#rb rob.krajcarski
#preflight 634db3d67927b1ca31abb325

[CL 22588076 by stu mckenna in ue5-main branch]
2022-10-17 19:52:40 -04:00
kevin ortegren
a4e3e33083 Fix integer overflow causing FVolumeBounds to be populated with extreme bounds leading to checks and potential GPU issues.
Fixed Forward lights FarPlane max distance to match UE4, this was increased due to the change to WORLD_MAX.

#jira UE-166313
#rb sebastien.hillaire
#preflight 63401708437603cb0e1f54f0
#lockdown juan.canada
#rnx

[CL 22402943 by kevin ortegren in ue5-main branch]
2022-10-07 12:41:11 -04:00
andrew lauritzen
f8032f4743 Optimizations to light loop for shadowed lights:
- Move translucent injection outside the loop rather as it shares state and doesn't need barriers between it. This had already been done for unshadowed lights but this implements it for shadowed lights as well.
- Implement VSM one pass projection (still default off) even when clustered shading is not enabled. Has two paths in the regular light loop:
  1) If another effect (ex. light functions) needs to interact with the screen shadow mask, a VSM composite path is inserted that does a quick copy from the one pass projection shadow mask bits
  2) If only VSM is needed for the light, the lookup is rolled directly into the deferred lighting pixel shader, eliding the screen shadow mask entirely
Especially in the second case this significantly cuts down on GPU idle time and g-buffer bandwidth, improving the performance of scenes with small local lights

#rb ola.olsson, charles.derousiers
#preflight 633b36f9ba39998ce84c34dd
#jira UE-122099

[CL 22327084 by andrew lauritzen in ue5-main branch]
2022-10-04 01:25:53 -04:00
ola olsson
97954ce075 Added project setting to disable per-object translucency shadows (off by default)
#jira UE-157672
#rb Sebastien.Hillaire,Krzysztof.Narkowicz
#preflight 633ad42eef77394565fe472d

[CL 22305618 by ola olsson in ue5-main branch]
2022-10-03 11:35:41 -04:00
kenzo terelst
ee56085de5 - ComputeMeshFillMode doesn't require MeshBatch as parameter
- MeshPassProcessor create function takes feature level as create parameter
- MeshPassProcessor base stores the processor enum type (handy for reference and stat tracking per pass type)
 When pass enum value is not available then EMeshPassType::Num is used for now

#jira UE-139584
#rb Jason.Nadro, Mihnea.Balta, Zach.Bethel, Arciel.Rekman
#preflight 631b30f1304480f8f89fca35

[CL 21987972 by kenzo terelst in ue5-main branch]
2022-09-13 14:04:12 -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
Sebastien Hillaire
bc63e4ebc4 Strata - Fixed translucent shadow depth compilation issues.
#rb none
#preflight https://horde.devtools.epicgames.com/job/629deaed4e7b99bee71d347a

[CL 20518369 by Sebastien Hillaire in ue5-main branch]
2022-06-06 08:03:34 -04:00
Arciel Rekman
3dd36a1d5f Share translucency light volume textures between both views of a stereo pair (UE-148569).
#rb Rob.Srinivasiah
#jira UE-148569
#preflight 627143035e6ce673f442a3dc
#review @Robert.Srinivasiah

[CL 20026126 by Arciel Rekman in ue5-main branch]
2022-05-03 11:15:00 -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
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
b683d19cc7 Add light function support for Strata.
#rb none
#jira none
#fyi sebastien.hillaire
#preflight 61fd3a090a43b689e176cf75

[CL 18862853 by Charles deRousiers in ue5-main branch]
2022-02-04 09:41:27 -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
ben ingram
b9dc4df2d5 Update translucent light cascade computation to use doubles
Fix translucent light functions
#jira UE-140298
#rb none
#preflight none

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

[CL 18778881 by ben ingram in ue5-main branch]
2022-01-28 16:42:15 -05:00
ben ingram
106460c245 TranslatedWorldSpace for translucent lighting volume
#preflight 61f2e76575432e9e8e5b083e
#jira UE-140298
#rb none

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

[CL 18760859 by ben ingram in ue5-main branch]
2022-01-27 15:48:17 -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
sebastien hillaire
ab2cbe44e7 Refactored GetVolumeShadowingShaderParameters to use the cascaded setting available on the light shadow info.
Tested with Lumen on cloud, astmosphere, translucent lighting volume and volumetric fog.

#preflight https://horde.devtools.epicgames.com/job/61dd4b42892dee612b3de9e0
#rb none
[FYI] daniel.wright

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

[CL 18569938 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-11 04:46:17 -05:00
sebastien hillaire
2517a32e17 Clean up code that was duplicated three times for light volume shadowing.
This tech debt resolve was finally possible after I converted all VolumetricFog and Translucent volume lighting to be 100% RDG and not use LAYOUT_FIELDS.

Fog, Translucent and Sky tested succesfully + green autotests.

#preflight https://horde.devtools.epicgames.com/job/61d56c161f62d3ad4d55f233
#rb none
[FYI] daniel.wright

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

[CL 18517101 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-05 05:08:09 -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
sebastien hillaire
abcca46579 Refactoring FTranslucentLightingInjectPS to RDG.
#rb charles.derousiers
#preflight https://horde.devtools.epicgames.com/job/61d2d2329010df1954ef33e1
Green screenshot test: TranslucencyLightingMode

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

[CL 18500476 by sebastien hillaire in ue5-release-engine-test branch]
2022-01-03 06:44:16 -05:00
charles derousiers
4af0547a14 Remove inverse square falloff permutation.
#rb none
#jira none
#preflight 61b35f7f13028c27d2976a4a

#ROBOMERGE-AUTHOR: charles.derousiers
#ROBOMERGE-SOURCE: CL 18430444 in //UE5/Release-5.0/... via CL 18435300
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18435529 by charles derousiers in ue5-release-engine-test branch]
2021-12-10 17:46:30 -05:00
aurel cordonnier
a12d56ff31 Merge from Release-Engine-Staging @ 17791557 to Release-Engine-Test
This represents UE4/Main @17774255, Release-5.0 @17791557 and Dev-PerfTest @17789485

[CL 17794212 by aurel cordonnier in ue5-release-engine-test branch]
2021-10-12 21:21:22 -04:00
aurel cordonnier
69fe095547 Merge from Release-Engine-Staging @ 17636544 to Release-Engine-Test
This represents UE4/Main @17638339 and Dev-PerfTest @17636504

[CL 17638842 by aurel cordonnier in ue5-release-engine-test branch]
2021-09-27 19:54:25 -04: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