Commit Graph

1258 Commits

Author SHA1 Message Date
graham wihlidal
70093e350c 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 via CL 16590845
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16590853 by graham wihlidal in ue5-release-engine-test branch]
2021-06-08 15:19:37 -04:00
ola olsson
db2db203c2 Move SetupGPUInstancedDraws into FInstanceCullingContext
- provides easier iteration on related code, plus sets the stage for abstraction for desktop/mobile version.
#preflight 60bf64925bc96f0001ba7fe1

#ROBOMERGE-SOURCE: CL 16587267 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16587298 by ola olsson in ue5-release-engine-test branch]
2021-06-08 10:55:24 -04:00
Ola Olsson
075ef36828 Move SetupGPUInstancedDraws into FInstanceCullingContext
- provides easier iteration on related code, plus sets the stage for abstraction for desktop/mobile version.
#preflight 60bf64925bc96f0001ba7fe1

[CL 16587267 by Ola Olsson in ue5-main branch]
2021-06-08 10:54:17 -04:00
graham wihlidal
8b020c3ff5 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 via CL 16583193
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v828-16531559)

[CL 16583202 by graham wihlidal in ue5-release-engine-test branch]
2021-06-07 23:57:54 -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
aurel cordonnier
25a11deeac Merge from Release-Engine-Staging @ 16579919
This represents UE4/Main @ 16579691 and Dev-PerfTest @ 16579576

[CL 16581170 by aurel cordonnier in ue5-release-engine-test branch]
2021-06-07 20:09:45 -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
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
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
ben zeigler
6c301cae85 #jira UE-2848 Blueprint function category and display name cleanup pass:
Add spaces to overridden display names, it doesn't add them automatically
Move some functions out of Utilities into their own categories like Transformation, this improves the UX for the node picker and Utilities is for Core functionality
Simplify and combine some redundant categories
Clean up functions like IsValid to specify the type and attempt to unify case for math functions
#rb ben.hoffman

[CL 16355176 by ben zeigler in ue5-main branch]
2021-05-17 13:26:33 -04:00
Patrick Enfedaque
465f251a77 Landscape Splines: Fix checkSlow failing PostDuplicate (missing update of transient maps)
#rb francis.hurteau
#preflight 60a249e813a166000178565a

[CL 16347312 by Patrick Enfedaque in ue5-main branch]
2021-05-17 07:45:56 -04:00
Francis Hurteau
cb71fe4f44 Fix assert occcuring when copying/duplicating map that contains landscape splines and register the component on an unitialized world.
#rb Patrick.Enfedaque
#jira UE-115715
#preflight 609ed20af6c6e300013d9f09

[CL 16335967 by Francis Hurteau in ue5-main branch]
2021-05-14 16:56:14 -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
danny couture
9332b64809 Prepare for the deprecation of direct access to the Resource member of UTexture in favor of the GetResource() accessor.
#rb Francis.Hurteau
#preflight 609e5182ef86d30001ad0a18
#rnx

[CL 16328103 by danny couture in ue5-main branch]
2021-05-14 07:17:32 -04:00
jonathan bard
2b0d389910 Fixed crash when drawing landscape BP brushes :
* Added game thread-only version of draw events in order to avoid the mistake of pushing a draw event on the main thread using an immediate command list, and popping it on the main thread later on, while the original command list may have been destroyed already.
* FDrawEvent is now able to be started/stopped on the game thread (no command list provided : a render command using the current immediate command list will be issued on both start and end) or the rendering/RHI threads (same as now : the command list passed in the start function will be the one used in the end function)
* Fixed potential similar issue with Begin/EndDrawCanvasToRenderTarget and DrawMaterialToRenderTarget BP functions
* Fixed potential similar issue with FGPUSkinCache end of frame updates (+ fixed FGPUSkinCache::BeginBatchDispatch being ifdefed-out by #if WANTS_DRAW_MESH_EVENTS)

#rb mihnea.balta, chris.waters, josie.yang
#jira none
#tests editor, PF

#p4v-cherrypick 16311819

#ROBOMERGE-OWNER: jonathan.bard
#ROBOMERGE-AUTHOR: jonathan.bard
#ROBOMERGE-SOURCE: CL 16311809 in //Fortnite/Main/... via CL 16311812 via CL 16314912 via CL 16314932
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Test -> Main) (v804-16311228)

[CL 16314939 by jonathan bard in ue5-main branch]
2021-05-13 13:12:56 -04:00
aurel cordonnier
8eebe8841f Merge UE5/RET @ 16305968 to UE5/Main
This represents UE4/Main @ 16261013 and Dev-PerfTest @ 16259937

[CL 16306996 by aurel cordonnier in ue5-main branch]
2021-05-12 18:10:03 -04:00
jonathan bard
5aec7b05ee * Fixed bad code merge leading to checking for landscape resources readiness twice
* Removed unused temporary command line option "nolandscapelayerupdate"

#rb jeremy.moore
#jira none
#rnx

[CL 16270325 by jonathan bard in ue5-main branch]
2021-05-11 11:06:26 -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
Patrick Enfedaque
dd3bb8ddab WorldPartition: Landscape delete support
#rb jeanfrancois.dube, richard.malo
#preflight 608c40defbb5fc00012303b8

[CL 16171455 by Patrick Enfedaque in ue5-main branch]
2021-04-30 14:44:39 -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