Commit Graph

293 Commits

Author SHA1 Message Date
graham wihlidal
1b2976b0c9 Big cleanup/refactor of InstanceData* (renamed to InstanceSceneData* to match many other places already calling it that, and to disambiguate upcoming changes that add another instance data buffer to GPU Scene for arbitrary data payloads). This change also removes the virtuals on FPrimitiveSceneProxy for the instance list along with lots of copy paste code for all the derived types, and instead makes it a built-in feature of the base proxy (since nearly everything supports GPU Scene instancing now).
#rb ola.olsson
[FYI] brian.karis
#preflight 60c4d5c586ce760001377f2a


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16660135
#ROBOMERGE-BOT: (v834-16658389)
#ROBOMERGE-CONFLICT from-shelf

[CL 16660883 by graham wihlidal in ue5-main branch]
2021-06-14 13:42:46 -04:00
ola olsson
5560667259 Tracking GPU-Scene dirty state and specialize Primitive Id only updates to avoid redundant uploads.
- Added instance data validation
- Added general load balancer for instance processing on GPU (will move to own files later)
- Added initial GPU-side write access API for GPU scene.
- Addded specialized kernel to update primitive IDs in instances when that is the only change.

#rb graham.wihlidal
#jira UE-116671
#preflight 60c25d7b1264df0001aab80b


#ROBOMERGE-SOURCE: CL 16628528
#ROBOMERGE-BOT: (v831-16623017)

[CL 16628539 by ola olsson in ue5-main branch]
2021-06-10 15:46:35 -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
graham wihlidal
4ec3fc585b Removed LocalToWorld and PrevLocalToWorld from FPrimitiveInstance (instead the concatenating of instance and primitive transforms happens during SoA construction right before GPU Scene upload). In the future we'll also have a custom GPU Scene upload kernel that can do things like the concatentation (among other derivations) right on the GPU, but not affect the hot path of stuff like GetInstanceData(). This change also renames (Prev)InstanceToLocal to (Prev)LocalToPrimitive to make a lot more sense than the previous naming.
#rb ola.olsson, krzysztof.narkowicz, rune.stubbe
[FYI] brian.karis, jason.nadro


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

[CL 16614986 by graham wihlidal in ue5-main branch]
2021-06-09 19:08:26 -04:00
graham wihlidal
0d916441a5 Instance data optimization - removed RenderBounds member, and refactored LocalBounds
#rb ola.olsson
[FYI] brian.karis, rune.stubbe, krzysztof.narkowicz


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16590738
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16590845 by graham wihlidal in ue5-main branch]
2021-06-08 15:18:30 -04:00
graham wihlidal
67923137a7 More instance data memory and CPU optimizations, and general refactoring.
* Moved Nanite resource ID and hierarchy offset back to primitive data (indirection cost is largely noise these days, and memory savings is more important - GetInstanceData() fetches this data and stores in the pre-existing registers so all the callsites don't have to worry about it).
* Removed FNaniteInfo from FPrimitiveInfo (and the type itself) in favor of just having a 32bit per-instance hierarchy root offset. Hierarchy offset and runtime resource ID just sourced from primitive.
* Removed PrimitiveID from CPU instance data (GPU still needs it). This value was redundantly stored per-instance, and now the GPU Scene upload just blits it over from primitive when the instance data is uploaded.
* Added new virtual GetNaniteResourceInfo on FPrimitiveSceneProxy that retrieves the Nanite resource ID and hierarchy offset stored on a given primitive (needed now that FPrimitiveInstance doesn't cache a copy). The non-virtual FPrimitiveSceneProxy::IsNaniteMesh() helper is used to avoid this virtual function call for non-Nanite proxies.
* Removed deprecated and no longer referenced Nanite::FResources array on FNaniteGeometryCollectionSceneProxy
* Removed expensive per-instance checks() in a few spots
* Stubbed out upcoming per instance payload allocator offset
* Removed deprecated and never referenced non-GPUScene GetInstanceData uniform buffer path
* Significantly cleaned up and optimized a lot of ISM instance data retrieval, including avoiding unnecessary FRenderTransform <-> FMatrix conversions.
* Removed GetInstanceShaderValues API, it was inefficient and annoying to require retrieval of all parameters when often only one or two of them were ever used. In some cases even the origin was unused but .w was needed because of the per-instance random packing.
* Implemented explicit GetInstanceRandomID() accessor to fetch (under current packing) Origin.W without exposing this to the callsites
* Implemented public API for GetInstanceLightMapData(), since the internal version was only accessible by GetInstanceShaderValues()
* Renamed GetInstanceShaderCustomDataValues() -> GetInstanceCustomDataValues() for API consistency

#rb jason.nadro, krzysztof.narkowicz
[FYI] rune.stubbe, brian.karis


#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16583156
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf

[CL 16583193 by graham wihlidal in ue5-main branch]
2021-06-07 23:55:28 -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
Ola Olsson
df492855e0 Removed GPUCULL_TODO define (fixed in on-state)
#preflight 60acc49b58f02e0001a0a996
#rb graham.wihlidal,Arciel.Rekman,Brandon.Schaefer,will.damon

[CL 16446355 by Ola Olsson in ue5-main branch]
2021-05-25 08:15:14 -04:00
Andrew Davidson
4d22d52a7b LWC: miscellaneous type fixes
#rb trivial
#preflight 60acd27b04188d0001d886bf

[CL 16446145 by Andrew Davidson in ue5-main branch]
2021-05-25 07:27:25 -04:00
krzysztof narkowicz
562b1b2de2 Disable Lumen card shader compilation in Landscape's thumbnails
[FYI] Jonathan.Bard, Daniel.Wright

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

[CL 16370971 by krzysztof narkowicz in ue5-main branch]
2021-05-18 13:31:03 -04:00
Sebastien Lussier
1ee8e44ac5 Expose some Landscape classes to ease plugin development
#rb patrick.enfedaque

[CL 16328766 by Sebastien Lussier in ue5-main branch]
2021-05-14 08:54:31 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
brandon dawson
4da77d6fab Fix for major frame hitches when adding levels to a world. Previously, adding a level to the world would trigger a linear loop through all primitives in the scene, testing to see if they were in the current level, and calling OnLevelAddedToWorld() if they were flagged to do so. The more primitives in the scene, the larger the hitch.
Now, proxiess can register for needing an on added/removed from level call.  If this is requested, they are added to a map, which maintains a list of primitives that need the add/remove call, per level.

The only component that currently utilizes this is the Landscape component.  To facilitate it's needs, the generic flags used to determine if it should be visible have been removed from FPrimitiveSceneProxy, bRequiresVisibleLevelToRender bIsComponentLevelVisible, and replaced with bForceHidden.  The landscape component will now set that flag under the same circumstances as before.

[REVIEW] [at]sebastien.lussier [at]Nick.Whiting [at]patrick.enfedaque
#jira UE-UE-114943
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16207473 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v796-16191650)

[CL 16207501 by brandon dawson in ue5-main branch]
2021-05-05 10:47:54 -04:00
Yuriy ODonnell
71ffbb1aaa Feed the right FeatureLevel into BuildRayTracingInstanceMaskAndFlags()
#rb Jason.Nadro

[CL 16170354 by Yuriy ODonnell in ue5-main branch]
2021-04-30 13:24:59 -04:00
dmytro vovk
eab8b64ef1 Removed Scene Software Occlusion
#jira none
#rb Dmitriy.Dyomin

[CL 16158927 by dmytro vovk in ue5-main branch]
2021-04-29 13:14:48 -04:00
rune stubbe
1aec74be8a Removed member LocalToInstance from FPrimitiveInstance as it is no longer read anywhere. Saves 64 bytes of system memory per instance.
#rb graham.wihlidal
#jira UETOP-1089
#lockdown nick.whiting

#ROBOMERGE-OWNER: rune.stubbe
#ROBOMERGE-AUTHOR: rune.stubbe
#ROBOMERGE-SOURCE: CL 16053670 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
#ROBOMERGE-CONFLICT from-shelf

[CL 16060977 by rune stubbe in ue5-main branch]
2021-04-20 10:22:10 -04:00
Jason Nadro
6a541e05ce Fix aggressive skipping of adding geometry for ray tracing.
- We want to skip adding geometry that will run through FRayTracingDynamicGeometryConverterCS and does not have a supported vertex factory type.
- I've moved checking the vertex factory type from the beginning of the function to happen closer to where we add primitives to the DynamicRayTracingGeometriesToUpdate list (which are the primitives that route through FRayTracingDynamicGeometryConverterCS)
- This is a follow up on CL# 15920326

#rb Yujiang.Wang
#review-15980032
#jira UE-110896

[CL 15982018 by Jason Nadro in ue5-main branch]
2021-04-12 15:37:39 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
Jason Nadro
9672daef9a Don't add primitives to be ray traced if they use an unsupported vertex factory type.
- This fixes a handful of crashes where ray tracing code would fail to find shaders for VF types that were not supported when we went to render.
- Added early out code in each proxy's GetDynamicRayTracingInstances() function to avoid adding ray tracing instances if we don't support the VF Type.
- I attempted to to early out of the function as early as possible.
- Since skeletal mesh sections can in theory have different vertex factories we have to check each one.  The logic I've gone with is that if _any_ section uses an unsupported VF we opt out of adding any of the sections to ray trace.  The result would be the whole skeletal mesh won't draw (idea being we wouldn't want partial meshes being draw).

#rb Juan.Canada
#review-15915627 @Yuriy.ODonnell, @Juan.Canada
#jira UE-110896

[CL 15920326 by Jason Nadro in ue5-main branch]
2021-04-05 14:26:31 -04:00
Yuriy ODonnell
4ae3c4c98d Added EVertexFactoryFlags::SupportsRayTracingDynamicGeometry to avoid FindVertexFactoryType() calls in IsSupportedDynamicVertexFactoryType().
[CL 15887835 by Yuriy ODonnell in ue5-main branch]
2021-04-01 08:18:18 -04:00
Yuriy ODonnell
436770a5c0 Require MaxVertices to be provided per ray tracing geometry section when creating FRHIRayTracingGeometry objects.
#jira UE-110910
#rb Yujiang.Wang

[CL 15746271 by Yuriy ODonnell in ue5-main branch]
2021-03-19 07:30:59 -04:00
Yuriy ODonnell
a011537508 Added EVertexFactoryFlags::SupportsRayTracing
#rb Kevin.Ortegren

[CL 15582667 by Yuriy ODonnell in ue5-main branch]
2021-03-03 10:40:14 -04:00
Yuriy ODonnell
1deef8bdf1 Added EVertexFactoryFlags and refactored IMPLEMENT_VERTEX_FACTORY_TYPE macros to avoid bool parameters.
#rb Charles.deRousiers, Luke.Thatcher
#robomerge Release-5.0-EarlyAccess

[CL 15581175 by Yuriy ODonnell in ue5-main branch]
2021-03-03 09:25:40 -04:00
Wei Liu
0be763ab65 Remove a unused mobile base pass shader permutation class.
Wrap the 'min' instuction with ALLOW_STATIC_LIGHTING macro in mobile base pass pixel shader.

#jira none

#rb Dmitriy.Dyomin, Jack.Porter, Mi.Wang

[CL 15578597 by Wei Liu in ue5-main branch]
2021-03-02 22:52:43 -04:00
will damon
0a298b5d97 Disable GPU culling on Apple and Linux platforms.
- Convert preprocessor 'defined(GPUCULL_TODO)' checks to 'GPUCULL_TODO'
- Define GPUCULL_TODO to 0 for Apple and Linux platforms

#rb rolando.caloca
[FYI] carl.lloyd brandon.schaefer ola.olsson lukas.hermanns graham.wihlidal
#jira UE-109070
#rnx

#ROBOMERGE-OWNER: will.damon
#ROBOMERGE-AUTHOR: will.damon
#ROBOMERGE-SOURCE: CL 15502801 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
#ROBOMERGE-CONFLICT from-shelf

[CL 15503935 by will damon in ue5-main branch]
2021-02-23 15:21:24 -04:00