Commit Graph

47 Commits

Author SHA1 Message Date
graham wihlidal
32e893af72 Fix for race condition where GCs might reach the call to RequestGPUSceneUpdate() on initial proxy creation before the primitive scene info has a valid index (entry in GPU Scene bookkeeping), causing the updates to silently skip. Normally this problem doesn't affect the majority of GCs, since most GCs have identify transforms in rest pose, except some GCs authored in external DCC tools could use non-identify transforms that wouldn't be correctly uploaded to GPUScene until simulation would start. Also took the time to remove the virtual function calls on IsNaniteMesh() and IsAlwaysVisible() since these are called super heavily in frustum culling and init views on the CPU.
#rb brett.miller
[FYI] brice.criswell, nick.whiting, brian.karis
#jira UE-115088

#ROBOMERGE-SOURCE: CL 16261925 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v799-16237190)

[CL 16264515 by graham wihlidal in ue5-main branch]
2021-05-11 01:18:05 -04:00
brett miller
4e958929e7 GeometryCollectionSceneProxy - Properly initialized LocalToWorld transform on Nanite scene proxy.
#jira UE-115088
#rb brice.criswell
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16261304 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v799-16237190)

[CL 16264510 by brett miller in ue5-main branch]
2021-05-11 01:17:48 -04:00
brett miller
6395ede18b GeometryCollectionSceneProxy
-- 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]
2021-05-04 16:15:19 -04:00
graham wihlidal
254c5dedc9 Corrected OnMotionBegin/OnMotionEnd to run on the render thread, and refactored the previous in motion logic to use the new events.
#jira UETOP-1595
#rb brett.miller
#lockdown nick.whiting
[FYI] brice.criswell

#ROBOMERGE-SOURCE: CL 16178780 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v792-16166999)

[CL 16178783 by graham wihlidal in ue5-main branch]
2021-05-01 21:33:36 -04:00
brett miller
3e4e8bd152 GeometryCollectionComponent
-- 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]
2021-05-01 17:51:29 -04:00
graham wihlidal
efab24f960 Fix duplicate symbol unity build error
#rb trivial
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16151929 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16151940 by graham wihlidal in ue5-main branch]
2021-04-28 21:27:58 -04:00
graham wihlidal
28742c1787 Fixed locked previous GC transforms (locked motion blur) by detecting dynamic->static transition and resetting previous transforms to current.
#rb brice.criswell
[FYI] brett.miller
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16150932 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16150970 by graham wihlidal in ue5-main branch]
2021-04-28 19:53:28 -04:00
graham wihlidal
0fa361fa13 Fixed Nanite geometry collection velocity vectors, and optimizing transform updates for dummy GPU scene instance culling placeholders. Scene proxies can now fully own the concatenation of transform updates and avoid doing incorrect or redundant work during GPU Scene updates.
#jira UETOP-1352
#rb brandon.dawson
[FYI] ola.olsson, brian.karis, brice.criswell, brett.miller, michal.valient
#lockdown nick.whiting

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

[CL 16141875 by graham wihlidal in ue5-main branch]
2021-04-28 05:36:47 -04:00
brett miller
398661ca53 Fracture Tool
-- Removes Strip tool and fixed Validate tool to refresh Nanite geometry correctly.

#jira UE-113611
#rb brice.criswell
#lockdown nick.whiting

#ROBOMERGE-SOURCE: CL 16079452 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v789-15992632)

[CL 16079465 by brett miller in ue5-main branch]
2021-04-21 15:32:56 -04:00
graham wihlidal
ba3a7bf41e Rewrite of UGeometryCollection::InitDynamicData()
* 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]
2021-04-20 10:45:04 -04:00
brice criswell
3b557eb218 Geometry Collection : Render Bounds
- 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]
2021-04-20 10:31:10 -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
Benn Gallagher
c7cced57cd Geometry Collection : Cache Attribute
- 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]
2021-04-20 09:50:07 -04:00
graham wihlidal
9ae7a8e6d3 Fixes for the horrible Nanite "black material" shading and broken hit proxies.
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]
2021-03-18 05:41:34 -04:00
graham wihlidal
c8e538778b Trivial code cleanup
#rb trivial
#robomerge Release-5.0-EarlyAccess

[CL 15735759 by graham wihlidal in ue5-main branch]
2021-03-18 04:00:57 -04:00
ola olsson
2ece048c33 Moved Geometry Collection from Local Vertex Factory to a dedicated VF.
- Simplifies the ifdef logic in both and cleans up naming significantly.
- also added support for GPU-scene instance culling.

#rb Graham.Wihlidal

#ROBOMERGE-SOURCE: CL 15567860 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15567868 by ola olsson in ue5-main branch]
2021-03-02 06:33:07 -04:00
daniel wright
bdf3b979a8 Components being moved by editor tracking render velocities correctly
* Added new PrimitiveComponent flag bIsBeingMovedByEditor which is enabled by the editor when it moves an actor through the gizmos.
* Velocity rendering now draws components being moved by the editor on top of the usual Movable components
#rb Matt.Kuhlenschmidt

#ROBOMERGE-SOURCE: CL 15373844 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)

[CL 15373874 by daniel wright in ue5-main branch]
2021-02-09 23:05:37 -04:00
graham wihlidal
83c3ff798a Removed redundant primitive uniform buffer creation/uploads for Nanite static meshes and geometry collections
#rb brian.karis
#fyi ola.olsson

[CL 15282325 by graham wihlidal in ue5-main branch]
2021-02-02 14:40:50 -04:00
graham wihlidal
74c3616cd6 Trivial cleanup
#rb trivial

[CL 15277251 by graham wihlidal in ue5-main branch]
2021-02-01 20:57:31 -04:00
graham wihlidal
de9653ec9f Nanite support for per-instance random and lightmap/shadowmap UV bias.
Removed WorldToLocal from GPUScene packed instance data (now derived) to save 8 bytes (after new fields).
Fixed calculation of Instance.LocalToInstance.

#jira UE-105083
#rb brian.karis
#fyi rune.stubbe

[CL 15076426 by graham wihlidal in ue5-main branch]
2021-01-13 19:51:21 -04:00
Emil Persson
72db809300 Replace legacy LockVertexBuffer()/LockIndexBuffer()/LockStructuredBuffer() calls with the unified LockBuffer()
#rb kenzo.terelst

[CL 14898308 by Emil Persson in ue5-main branch]
2020-12-10 11:51:32 -04:00
graham wihlidal
70f838562c Greatly improved error messaging when an invalid material is applied to a Nanite static mesh or geometry collection, so artists can more easily debug what the problem is.
#rb andrew.lauritzen

[CL 14856964 by graham wihlidal in ue5-main branch]
2020-12-04 14:51:23 -04:00
graham wihlidal
0e876d9805 Fixed Nanite Geometry Collection crashes and incorrect rendering on cooked platforms.
#rb rune.stubbe
#fyi brian.karis, benn.gallagher, michael.lentine

[CL 14638967 by graham wihlidal in ue5-main branch]
2020-11-02 21:12:24 -04:00
Marc Audy
68150e0be7 Merge UE5/Release-Engine-Staging to UE5/Main @ 14611496
This represents UE4/Main @ 14594913

[CL 14612291 by Marc Audy in ue5-main branch]
2020-10-29 13:38:15 -04:00
graham wihlidal
25bb0676cb Fixed dynamic velocity vectors on non-Nanite geometry collection meshes.
#rb brian.karis
#fyi daniel.wright, devon.penney

[CL 14468546 by graham wihlidal in ue5-main branch]
2020-10-10 00:48:41 -04:00