* 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]
This change is another basis for more instance data and GPUScene improvements coming down the pipe.
#rb jason.nadro, krzysztof.narkowicz, zach.bethel, zak.middleton, rune.stubbe, ben.woodhouse
[FYI] brian.karis, ola.olsson
#preflight 60b9608d0249c300016598de
#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16555619
#ROBOMERGE-BOT: (v828-16531559)
#ROBOMERGE-CONFLICT from-shelf
[CL 16555914 by graham wihlidal in ue5-main branch]
-- Support for Nanite to GeometryCollection conversion
-- Support for multiple UV sets
#jira UE-114992
#rb jimmy.andrews
[FYI] brice.criswell
#ROBOMERGE-OWNER: peter.knepley
#ROBOMERGE-AUTHOR: brett.miller
#ROBOMERGE-SOURCE: CL 16363667 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)
#ROBOMERGE-CONFLICT from-shelf
[CL 16370251 by peter knepley in ue5-main branch]
- Require 64bit atomic support for Nanite by default now (r.Nanite.RequireAtomic64Support=1)
- Cleaned up a bunch of cvar component reattach callbacks to use lambdas instead of redundant global functions
- Added UStaticMesh::HasValidNaniteData() as a helper to check if an asset has valid Nanite data
- Improved Nanite unsupported on screen error message so that we don't asks the user to update GPU drivers on a console :)
#rb nick.whiting
#jira UETOP-1646
[FYI] brian.karis, michal.valient
#ROBOMERGE-OWNER: graham.wihlidal
#ROBOMERGE-AUTHOR: graham.wihlidal
#ROBOMERGE-SOURCE: CL 16363554 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v804-16311228)
#ROBOMERGE-CONFLICT from-shelf
[CL 16363648 by graham wihlidal in ue5-main branch]
- change matrix types for dynamic data to be explicitly using float
- wrapped update of vertex buffer to ensure type check
- When LWC mode is on, convert double based matrices to they float equivalent ( sub-optimal, but necessary for now until we have a better way )
#jira UE-115570
#fyi brice.criswell, brett.miller
[CL 16333456 by cedric caillaud in ue5-main branch]
-- OnMotionEnd now resets instance transforms as well as component transforms.
#jira UETOP-1546
#rb brice.criswell
#lockdown nick.whiting
#ROBOMERGE-SOURCE: CL 16198557 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v796-16191650)
[CL 16198575 by brett miller in ue5-main branch]
-- Added state machine logic and scene proxy callbacks for triggering when motion begins and ends.
#jira UETOP-1546
#rb graham.wihlidal
#lockdown nick.whiting
#ROBOMERGE-SOURCE: CL 16178376 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v792-16166999)
[CL 16178381 by brett miller in ue5-main branch]
* Implemented thread safe object pool / free list allocator (FGeometryCollectionDynamicDataPool)
* Added Chaos stats for total transforms and changed transforms
* Removed TransformsAreEqual mechanism that caused full transform updates to occur unnecessarily for 2 subsequent frames, as the state wasn't stable until the previous 3 frames were stable. This was incredibly innefficient for GPUScene, etc..
* InitDynamicData now returns the data allocation (which can be null if not dynamic or if no transforms have changed), users of this now check if it's available, and either skip or fall back to the static/rest path otherwise
* Cleaned up some code paths by combining them with similar passes
* Removed tons of allocations, including heavy allocations/memcopies of transform data, even on stable frames (which were immediately deallocated right after allocation and setup of the dynamic data)
* Saves ~0.5 to 1.0ms of CPU time in heavy scenes
* Saves ~0.5ms of GPU time doing far less GPUScene updates
* Main optimization around this refactor is forthcoming in a followup CL (avoid calling MarkRenderTransformDirty in TickComponent).
#rb brett.miller, brice.criswell
#lockdown nick.whiting
[FYI] brian.karis, rune.stubbe
#jira UETOP-1088
#ROBOMERGE-SOURCE: CL 16059409 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
[CL 16061411 by graham wihlidal in ue5-main branch]
- Fix to an indexing error when the bounds are setup on the FNaniteGeometryCollectionSceneProxy, and a transform error when updating the instance bounds.
#jira UE-113611
[FYI] brett.miller, graham.wihlidal
#lockdown nick.whiting
#ROBOMERGE-SOURCE: CL 16057336 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
[CL 16061147 by brice criswell in ue5-main branch]
- Strip geometry attributes from the collection when using the collection as a simulation viewer.
- Use the transferred bounds on the minimal asset for rendering bounds.
- Minor clean to expose user controllable cache only state to the GeometryCollectionObject
#jira UE-113611
#rb Brett.Miller
[FYI] Graham.Whlidal
#lockdown nick.whiting
#ROBOMERGE-OWNER: Benn.Gallagher
#ROBOMERGE-AUTHOR: brice.criswell
#ROBOMERGE-SOURCE: CL 16052869 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)
#ROBOMERGE-CONFLICT from-shelf
[CL 16060655 by Benn Gallagher in ue5-main branch]
Pretty nasty one where material slots are manually added/changed (differing from LOD0), Nanite encodes the material tables from that, but then the LOD0 of the mesh (which drives mesh draw commands wrt. material interfaces) no longer matches correctly 1:1, so you can have 1 mesh section with 1 material interface, but it's actually using material index 1.
From the normal mesh draw command side of things, this is all handled nicely, but Nanite and GPUScene don't upload LOD0 data, we go off of material slots when encoding the tables (we don't care about the LOD data). Basically it means we'd upload a material table entry to GPU Scene at (say) slot 1280 with a given depth value (as if the relative material index is 0), but the cluster material encoding would say the relative index is 1, causing depth export and culling to lookup the depth value from slot 1281 instead.
Reverb was mainly single material meshes (with a few exceptions), so we never encountered all the reimport and mismatch fun, and even for a long time on Frosty, multiple materials were fine (and of course well tested previously).
The start of the problems came from the previous bug of LOD0 coarse mesh simplification killing unreferenced materials, scrambling the indexing - while that bug was being fixed by us, artists started trying to fix it on their end by manually adjusting material slots, etc. This left a ton of meshes behind with crazy indexing like this, where even disabling coarse mesh still results in mismatches between LOD0 and the material slots.
While making these fixes, I also made a number of CPU optimizations to various parts of the Nanite material rendering code, and also refactored a lot of the geometry collection and (H)(I)SM deferred material code into a common path shared by all Nanite proxies.
#rb ola.olsson
#fyi brian.karis, rune.stubbe, juan.canada
#jira FROST-1224
#robomerge Release-5.0-EarlyAccess
[CL 15736080 by graham wihlidal in ue5-main branch]