Commit Graph

124 Commits

Author SHA1 Message Date
yuriy odonnell
369f054047 Add CVar r.SceneDepthHZBAsyncCompute to run HZB generation on async compute
* This avoids GPU under-utilization in scenes where a very large number of individual occlusion queries is issued
* Possible r.SceneDepthHZBAsyncCompute values:
  * 0: Don't use async compute (default)
  * 1: Use async compute, start as soon as possible
  * 2: Use async compute, start after ComputeLightGrid.CompactLinks pass

#preflight 636c555f7c2b5051903a24ca
#rb Graham.Wihlidal

[CL 23072519 by yuriy odonnell in ue5-main branch]
2022-11-10 03:03:38 -05:00
Charles deRousiers
48b3286bc0 Add IES atlas texture manager.
This persistent atlas hold IES texture in a unique texture array which is used by all systems (raster/RT/PT/Lumen), and unify IES profile rendering.

#rb chris.kulla, sebastien.hillaire, krzysztof.narkowicz
#jira UE-167618
#preflight 6356fd907261e565c436a0fb

[CL 22806455 by Charles deRousiers in ue5-main branch]
2022-10-27 04:36:31 -04:00
wouter dek
60222e1105 Add list of lights to GPU scene, mirroring Scene::Lights. Each element contains the view-independent properties of the light.
#rb ola.olsson, charles.derousiers, sebastien.hillaire, matt.peters
#preflight 6356a0707261e565c41de278
#jira none

[CL 22727778 by wouter dek in ue5-main branch]
2022-10-24 11:07:32 -04:00
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
jeremy moore
df6465ec66 Remove some shader print debug shaders for platforms that shouldn't have them.
[CL 22393932 by jeremy moore in ue5-main branch]
2022-10-07 00:18:05 -04:00
Charles deRousiers
ba5a65e122 Remove unused dummy rect light texture.
#rb none
#jira none
#preflight 633e78350c2d12a85878d8c5

[CL 22372654 by Charles deRousiers in ue5-main branch]
2022-10-06 03:13:26 -04:00
Charles deRousiers
29c281a801 * Change rect light data parameter passing & packing.
* Rect light texture data are available for forward lighting.

#rb none
#jira none
#preflight 633db11ff171e4e68b29f20e

[CL 22372470 by Charles deRousiers in ue5-main branch]
2022-10-06 02:24:41 -04:00
Charles deRousiers
87a78bbe8b Add local light data packing functions.
#rb none
#jira none
#preflight 633d7252d74cbd55044922c6

[CL 22352849 by Charles deRousiers in ue5-main branch]
2022-10-05 08:08:53 -04:00
Charles deRousiers
e3ab36d33e Fix crash when running hair iin forward with AA set to MSAA.
#rb none
#jira none
#preflight 631b978fd135b61bc57366fb

[CL 21960900 by Charles deRousiers in ue5-main branch]
2022-09-12 02:05:06 -04:00
tiago costa
5d63c9fad9 Added option to apply inverse exposure to local lights
- This should only be used for gameplay lights.
- Current implementation adjusts light intensity on CPU using exposure data readback from GPU.

#preflight 631b4884d31788ea3a993a2f
#rb Krzysztof.Narkowicz

[CL 21929836 by tiago costa in ue5-main branch]
2022-09-09 18:16:47 -04:00
daniel wright
12f2dcb60a Experimental Lumen Direct Lighting - fast but low quality direct lighting through Lumen's Final Gather
* When r.Lumen.ScreenProbeGather.DirectLighting is enabled, all local lights will be rendered by Lumen (if enabled)
 * With 8 shadowed lights on screen, Lumen Direct Lighting costs .4ms, while Cached Shadowmaps cost (1.3ms), Distance Field Shadows are (1.8ms) and Virtual Shadow Maps (6.1ms) on a 2080 TI at 1080p resolution
 * IES profiles and Light Functions are not yet supported, nor is Hardware Ray Tracing
 * Shadowing and light attenuation resolution is tied to Screen Probe Gather downsampling so quality becomes poor with High GI settings (32x downsampling)
 * r.Lumen.ScreenProbeGather.LightSampleResolutionXY controls how many light samples are traced per Screen Probe, with lights being selected with equal probability.  More lights overlapping causes more noise, not increased GPU cost.

#ROBOMERGE-OWNER: daniel.wright
#ROBOMERGE-AUTHOR: daniel.wright
#ROBOMERGE-SOURCE: CL 21213896 via CL 21214406 via CL 21214468
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)

[CL 21214926 by daniel wright in ue5-main branch]
2022-07-22 00:56:31 -04:00
zach bethel
f6638993ed Upgraded CSV stats to RDG variants to include RDG pass executions to reduce RDG_Execute CSV tag.
[FYI] ben.woodhouse, jian.ru

#ROBOMERGE-AUTHOR: zach.bethel
#ROBOMERGE-SOURCE: CL 20951340 via CL 20951352 via CL 20951364
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20953292 by zach bethel in ue5-main branch]
2022-07-05 19:59:53 -04:00
andrew lauritzen
77d42db7c2 Add SpecularScale to light grid data so it can be used in clustered shading and forward lighting passes.
#rb ola.olsson
#preflight 62b2598e7a38e239e5a63d10

#ROBOMERGE-AUTHOR: andrew.lauritzen
#ROBOMERGE-SOURCE: CL 20779145 via CL 20780283 via CL 20780951
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v970-20704180)

[CL 20782479 by andrew lauritzen in ue5-main branch]
2022-06-22 17:45:31 -04:00
Sebastien Hillaire
fb16f8c1eb Make sure the light debug view is always visible even when nothing request the light grid.
#rb none
#preflight https://horde.devtools.epicgames.com/job/62a1d81cf73a01bd981d72b3

[CL 20574005 by Sebastien Hillaire in ue5-main branch]
2022-06-09 07:47:18 -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
Jeremy Moore
0d87578c23 ShaderPrint: Tidy up usage of IsEnabled etc.
IsEnabled() should just be if the system is turned on.
SetEnabled() is to turn the system on and off.
There is a per view variation of IsEnabled() which determines if it is set to capture output.
There is a new per view variation of IsValid() which determines if we can bind shader print parameters at all.
IsValid() is for use to avoid crashes and IsEnabled() is for use to early out or avoid work.
#preflight 629a64b36879a2ac679de20b

[CL 20491754 by Jeremy Moore in ue5-main branch]
2022-06-03 15:58:15 -04:00
Juan Canada
0091bd7424 Fixed assert triggering because baked depth data was invalid
#jira UE-153278
#rb yujiang.wang
#preflight 6291061c6c4b4192f2a4ccdd

[CL 20395456 by Juan Canada in ue5-main branch]
2022-05-27 13:23:22 -04:00
Sebastien Hillaire
712c172605 Added light grid culling debug pass.
#rb none
#preflight https://horde.devtools.epicgames.com/job/628c8ef7a24685c36f506f40

[CL 20345378 by Sebastien Hillaire in ue5-main branch]
2022-05-24 04:33:36 -04:00
zach bethel
ac6e75533b Replaced AddCopyToResolveTarget pass with render target resolve.
#preflight 6283ea93520eb4f0a55a85c5

[CL 20262493 by zach bethel in ue5-main branch]
2022-05-18 12:31:54 -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
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
Arciel Rekman
508efcb9a4 Fix lack of VolumetricFog in the right eye (UE-141871).
- Introduced by a fix for UE-125073 (second split-screen view influenced translucency in the first).

#jira UE-141871
#rb Rob.Srinivasiah, Zach.Bethel (in 5.0)
#review-19532401 @Robert.Srinivasiah, @Zach.Bethel, @Jules.Blok (in 5.0)
#preflight 623355741302f69e9a47d7af

[CL 19532397 by Arciel Rekman in ue5-main branch]
2022-03-28 16:02:02 -04:00