Commit Graph

586 Commits

Author SHA1 Message Date
guillaume abadie
d57405a01c Fixes SSGI caused by wrong texture being extracted into ViewState->PrevFrameViewInfo.ScreenSpaceRayTracingInput
#rb none
[FYI] zach.bethel


#ROBOMERGE-SOURCE: CL 16744132
#ROBOMERGE-BOT: (v835-16672529)

[CL 16744158 by guillaume abadie in ue5-main branch]
2021-06-22 12:03:46 -04:00
guillaume abadie
7f8b11f66e Implements r.Nanite.ViewMeshLODBias.*
#rb Rune.Stubbe, Brian.Karis


#ROBOMERGE-SOURCE: CL 16717647
#ROBOMERGE-BOT: (v835-16672529)

[CL 16717651 by guillaume abadie in ue5-main branch]
2021-06-18 06:43:50 -04:00
Jeremy Moore
68cfc3a82b Nanite can emit velocity directly to the velocity buffer during EmitDepth.
Only do this if not writing velocity from base pass/EmitGBuffer.
That would be needed if we want velocity early in the frame (eg for dbuffer last frame normal reprojection).
Added permutations to control whether velocity is written to all the flavors of  EmitDepth shader.
#rb graham.wihlidal

[CL 16703403 by Jeremy Moore in ue5-main branch]
2021-06-17 08:21:18 -04:00
Jian Ru
f16252beb2 Add an option to render distance field shadows using async compute. Also fix a bug where a raytraced DF FProjectedShadowInfo is rendered for all views instead of just its dependent view
#jira UE-114984
#rb ben.woodhouse, tiago.costa

[CL 16683751 by Jian Ru in ue5-main branch]
2021-06-15 22:28:34 -04:00
yuriy odonnell
3a50c634cd Added extra ray tracing scene build input validation on the render thread timeline, to attempt catching issues before RHI thread where some of the context is no longer available.
#ROBOMERGE-SOURCE: CL 16671689
#ROBOMERGE-BOT: (v834-16658389)

[CL 16671693 by yuriy odonnell in ue5-main branch]
2021-06-15 07:04:20 -04:00
aurel cordonnier
e0ad4e25df Merge from Release-Engine-Test @ 16624776 to UE5/Main
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16625248 by aurel cordonnier in ue5-main branch]
2021-06-10 13:13:24 -04:00
patrick kelly
37ad9aeef4 Hardware ray tracing support for LumenSceneDirectLighting.
The previous method has been replaced with a tiled work queue system.
At the high-level, Lumen cards are dispatched against a batch group of N lights (default=16).
Cards are chopped into 8x8 tiles of work, corresponding to the minimum Lumen card size, and subject to temporal and light culling.
Tiles which pass the culling stages are submitted to the raygen shader, where visibility is determined per light and stored in a 32-bit shadow mask.
Virtual shadow mask lookup was added as a potential late-time culling criteria in the ray-gen shader, but did not provide any noticeable traversal speedup. It is currently permuted out.
The shadow mask is applied as the visibility score to the direct lighting stage and used for off-screen shadowing.

r.LumenScene.DirectLighting.HardwareRayTracing (default=1)

Timing results for a single frame in Sun Temple with r.LumenScene.Lighting.ForceLightingUpdate=1 & r.LumenScene.DirectLighting.ForceOffscreenShadowing=1
Software Ray Tracing: 9.20ms
Hardware Ray Tracing: 8.16ms

Under normall circumstances, r.LumenScene.DirectLighting.ForceOffscreenShadowing=0 and provides a significant speedup for software tracing:
Software Ray Tracing: 4.83ms
Hardware Ray Tracing: 8.16ms

We expect to reclaim some speedup for hardware ray tracing by reordering the pipeline such that virtual shadow mapping can pre-populate the shadow mask and act as a more performant culling criteria.

#rb krzysztof.narkowicz


#ROBOMERGE-SOURCE: CL 16618392
#ROBOMERGE-BOT: (v828-16531559)

[CL 16618400 by patrick kelly in ue5-main branch]
2021-06-09 23:00:32 -04:00
charles derousiers
7d8bcb8556 Rename GpuDebugRendering -> ShaderDebug to be consistent with ShaderPrint.
#rb none


#ROBOMERGE-SOURCE: CL 16606836
#ROBOMERGE-BOT: (v828-16531559)

[CL 16606856 by charles derousiers in ue5-main branch]
2021-06-09 12:16:25 -04:00
Jian Ru
13d2d6e79e Batch BuildRenderingCommands from major mesh passes inside the main render function
#jira UE-117281
#rb ola.olsson, zach.bethel

[CL 16572282 by Jian Ru in ue5-main branch]
2021-06-07 12:19:06 -04:00
Jian Ru
764396adbe Fix a crash due to incorrect conditioning
#jira none
#fyi Patrick.Enfedaque

[CL 16551037 by Jian Ru in ue5-main branch]
2021-06-03 15:10:32 -04:00
Jian Ru
6a5f669d74 Do not extract HZBFurthest when nanite is disabled. This allows it to be allocated as a transient resource. Also reinstate the option to use half-res scene color as input to SSR. The option was accidentally lost during merge
#jira UE-117189
#rb zach.bethel

[CL 16550098 by Jian Ru in ue5-main branch]
2021-06-03 14:09:51 -04:00
Ola Olsson
91ed2ab3ba Move instance ID buffer to RDG and out of the View uniform buffer and into own UB.
- Enables overlapping batched and non-batched instance culling (needed for batching work).
 - Removes some explicit transitions & minor cleanup.
 - Added tracking the required number of instances (fixes non-nanite VSM for large ISMs)

#rb graham.wihlidal,jian.ru,yujiang.wang,zach.bethel
#preflight 60b73f38107dc600017d931b

[CL 16544217 by Ola Olsson in ue5-main branch]
2021-06-03 02:19:28 -04:00
Sebastien Hillaire
be6589d926 Missing file to go with 16510700.
#rb none

[CL 16510759 by Sebastien Hillaire in ue5-main branch]
2021-05-31 16:32:52 -04:00
aurel cordonnier
43fa62fcd8 Merge from Release-Engine-Test @ 16487383 to UE5/Main
This represents UE4/Main @ 16445039 and Dev-PerfTest @ 16444526

[CL 16488106 by aurel cordonnier in ue5-main branch]
2021-05-27 13:40:37 -04:00
Sebastien Hillaire
baed13200f AtmosphericFog component removal from UE5.
Clean up atmospheric fog and have it instaciate a sky atmosphere by default instead
AtmosphericFog now inherits from SkyAtmosphere and looks vaguely similar. Serialisation is handled with a serialisation enum + ue5 version.
"ClassRedirects" could not be used because parameters are not compatible and also due to different serialisation on both component.

So instead Skyamtosphere now has a bool bIsAtmosphericFog (false by default).
AtmosphericFog component now inheriting from Skyatmosphere is setting that to true so that serialisation can be properly handled for both cases : pure Skyatmosphere or SkyAtmosphere replacing a AtmosphericFog with loading/saving. This also supports StaticLightingGUID once converted, see USkyAtmosphereComponent::Serialize.

SkyAtmosphere aerial perspective is now properly gated behind the base pass vertex shader designed for that using BASEPASS_SKYATMOSPHERE_AERIALPERSPECTIVE.

Removed all AtmosphericFog related render code.
Renamed a bunch of shader permutation.

UActorFactoryAtmosphericFog is removed so that the actor is no longer visible and instanciable from menu (existing actors in levels are still created correctly)
UAtmosphericFogComponent is made notplaceable.

ShooterGame compiled and ran succesfuly.
Colton Daniels (QA) will upate reference screneshot in a later CL.

#rb Charles.derousiers, Marc.Audy, Kevin.Ortegren

[CL 16455741 by Sebastien Hillaire in ue5-main branch]
2021-05-25 16:33:27 -04:00
kenzo terelst
120d880864 Parallelize nanite command list generation - both rhi command list building and parallel translation
#rb Graham.Wihlidahl, Arne.Schober, Rune.Stubbe
#jira FROST-2660

#ROBOMERGE-SOURCE: CL 16445336 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v814-16434418)

[CL 16445343 by kenzo terelst in ue5-main branch]
2021-05-25 03:53:54 -04:00
zach bethel
90bc2efada RDG refactor to enable draining of work after issuing occlusion queries.
- New Drain() method on FRDGBuilder; will flush all pending work.
 - Drained passes are not culled; resource lifetimes are extended; async compute fences are optimized as best as possible but fence joining may occur after the drain.
 - Batch up and pre-build all resource transitions. This is a prerequisite for parallel command lists.
 - Removed ServiceLocalQueue passes with built-in RDG AddDispatchHint().

#jira UE-114622

[CL 16393495 by zach bethel in ue5-main branch]
2021-05-19 17:54:58 -04:00
chris kulla
5eff2bfa9b Fix crash in multi-view rendering
The SSS profile texture should be set in the View before we try to setup ray tracing light data.

#rb trivial
#preflight 60a2f498292e3200012c655e

[CL 16362174 by chris kulla in ue5-main branch]
2021-05-17 20:02:18 -04:00
yuriy odonnell
bb45edc97a Call WaitForRayTracingScene() before lighting if an earlier wait point was not forced by Lumen
#jira UE-115561

#ROBOMERGE-SOURCE: CL 16347467 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16347469 by yuriy odonnell in ue5-main branch]
2021-05-17 08:23:54 -04:00
Yuriy ODonnell
b5b4e59038 Fixed a crash due to AnyRayTracingPassEnabled returning true in some cases while ray tracing may be not supported (i.e. if certain RT features are force-enabled via CVars). Returning true from this function results in a check failure inside WaitForRayTracingScene() later.
#rb Juan.Canada

[CL 16299513 by Yuriy ODonnell in ue5-main branch]
2021-05-12 10:58:32 -04:00
Luke Thatcher
f820cebbc7 Globally disable "r.EnableAsyncComputeTranslucencyLightingVolumeClear" due to GPU crashes in async compute FClearTranslucentLightingVolumeCS shader.
- Was previously disabled only on selected platforms (UE-62964)

#jira UE-115098
#fyi Ben.Woodhouse, Zach.Bethel
#rb none

[CL 16250988 by Luke Thatcher in ue5-main branch]
2021-05-10 13:36:19 -04:00
chris kulla
6df4146582 Make sure we pick the no-lightmap shader permutation when using the path tracer
This is another small step towards enabling path tracing specific shader permutations.

This requires re-caching the raytracing mesh commands when we flip to and from path traced rendering.

Cleanup some flag handling by removing the redundant ERayTracingRenderMode enum since it is already capture by show flags.

Avoid checking the path tracing flag per view since it is always common to all views

Re-introduce the deduplication over views for the non-path tracing case since ray tracing effects can be enabled in a view dependent fashion.

Rename CanOverlayRayTracingOutput to HasRayTracedOverlay which I think is a bit clearer. Note that the meaning has flipped - it now returns true when path tracing or ray tracing debug modes are enabled.

Remove leftovers of GAveragePathTracedMRays (which wasn't hooked up to anything anymore)

Refactor static variables used to store path tracing state into a pimpl object off of the ViewState

#rb Patrick.Kelly, Yuriy.ODonnell, Juan.Canada

[CL 16249998 by chris kulla in ue5-main branch]
2021-05-10 12:22:42 -04:00
Jeremy Moore
ca5494be02 #jira FROST-2482
Add option to r.CustomDepth.Order to select before or after base pass based on DBuffer project setting.
Made this new option the default.
Means that custom stencil "just works" with DBuffer decals.
#rb none
#preflight 6096d93d6aff750001100a96

[CL 16243435 by Jeremy Moore in ue5-main branch]
2021-05-08 15:28:40 -04:00
zach bethel
524bedba2b Removed several RHI thread dispatch passes which are no longer necessary.
#rb none

[CL 16209263 by zach bethel in ue5-main branch]
2021-05-05 12:50:53 -04:00
zach bethel
032f9361de Avoid binding hair resources when hair is not enabled.
#rb charles.derousiers

[CL 16198658 by zach bethel in ue5-main branch]
2021-05-04 16:18:42 -04:00