* Moved LumenScene functionality into new LumenScene.cpp file
* Moved all Lumen data into FLumenPrimitive. FPrimitiveSceneInfo now contains just a LumenPrimitiveIndex
* Mesh cards are spawned only near the camera on demand. This saves ~200-300mb of GPU memory on big city levels, and also skips some GPU and CPU costs
* Fixed card merging (previously it was reusing MeshCards which could result in missing cards)
#ROBOMERGE-SOURCE: CL 15494971 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v771-15082668)
[CL 15494982 by krzysztof narkowicz in ue5-main branch]
Phase 1 adds the async compilation without introducing any higher-level awareness.
This step provides the biggest performance improvements by allowing skeletal mesh to be compiled in
multiple threads but stalls are expected to occur before the level has finished loading as soon as
properties of skeletal meshes are accessed by the game-thread.
- Make skeletal mesh reduction and renderdata building thread-safe where needed
- Add protection on all USkeletalMesh accessors so the game-thread can wait on data still being built if needed
- Modify both PostLoad and Build to be async when the feature is enabled
- Make FRawSkeletalMeshBulkData::LoadRawMesh thread-safe
- Fix some PropertyChangedEvent name comparison to use strongly typed GET_MEMBER_NAME_CHECKED
- Add an experimental setting options to enable the feature (disabled by default for now)
DEBUGGING
- Can be forcibly enabled/disabled through command-line via -asyncskeletalmeshcompilation=[off, on, paused]
- Can pause skeletal mesh compilation using Editor.AsyncSkeletalMeshCompilation = 2 or -asyncskeletalmeshcompilation=paused
- Can manually resume a specified amount of paused compilation using Editor.AsyncSkeletalMeshCompilationResume [Num]
- Can forcibly wait on all compilation using Editor.AsyncSkeletalMeshCompilationFlushAll
BENCHMARKS
Tested on AMD TR 3970X with 256GB RAM
- 6m50s to 2m58s for loading P_Construct with a local-only DDC that doesn't contains any prebuilt skeletal mesh
- 3m10s to 39s for importing 299 SK with the Interchange framework
TESTS
- Opened all 5769 SK from FortniteGame to exercise all legacy conversion code paths
- Opened all 102 SK from QAGame
- Opened P_Construct, Apollo_Terrain, LumenTest, P_World
- Imported 299 SK with and without Interchange activated
- Ensure no new regression introduced in any of the 70 SK related tests from EngineTest
- Run all FBX import test in EngineTest
- Cook / Run ShooterGame Client
#rb Alexis.Matte
[CL 15452895 by danny couture in ue5-main branch]
- Moved source models related classes and implementation into separate files.
- Created a new UObject wrapper for holding mesh description bulk data; this is created as a transactable object inside a UStaticMesh.
- The cached mesh description is now an inner object of the bulk data wrapper; this allows transactions on the bulk data to affect the cached mesh.
- The static mesh SourceModels array can no longer be accessed directly: FStaticMeshSourceModel requires extra initialization before it should be used, so new LODs should be added through the static mesh API.
- Undo/redo is now fixed within the geometry tools
- Fixed regression where mesh description was being unpacked unnecessarily during transactions
- MeshDescription bulk data and its cached MeshDescriptions are now emptied prior to removing the UObject reference, in order to immediately free memory instead of needing to wait for garbage collection
- No more deadlocks when clearing or committing mesh descriptions during garbage collection
- Bulk data UObjects are constructed, where possible, at startup, in order to prevent it from happening during critical moments, e.g. during garbage collection or package saving.
#rb Danny.Couture, Alexis.Matte, Ryan.Schmidt
[CL 15420827 by Richard TalbotWatkin in ue5-main branch]
i.e. This allows latency sensitive texture compression parallelfor from the gamethread to benefit from all the foreground threads and complete faster
#rb Arne.Schober
[CL 15387719 by danny couture in ue5-main branch]
* r.LumenScene.MeshCardsMaxLOD controls representation quality. With 0 being a box projection
* New card placement to focus on important parts of a mesh (skip non visible parts)
* Replaced CubeMapTrees with MeshCards. Instead of a big volume texture lookup there are now 6 lists of decals (one per axis)
* Merged distance field and mesh card Embree setup code into a set of common functions
* Removed hardcoded limits of 6 cards per mesh
#fyi Daniel.Wright, Patrick.Kelly, Yuriy.ODonnell
[CL 15144947 by Krzysztof Narkowicz in ue5-main branch]
Adding a public member to USkeletalMesh class is now prohibed since it can break asynchronous operations that will be added next to this submit.
#rb danny.couture
#jira UEENT-3936
#rnx
[CL 14812920 by Alexis Matte in ue5-main branch]
This is later used to build static mesh derived data in cases where Nanite coarse mesh representation replaces original static mesh data and we can't depend on it. In extreme cases it lowers main thread derived data build time from ~7.5s to ~0.1s.
#rb Richard.TalbotWatkin
[CL 14578414 by Krzysztof Narkowicz in ue5-main branch]
* Fixed section filtering bug causing to generate SDF from random triangles when a single section was filtered out
* Removed plane hack, which was squashing some meshes and causing generation rays to randomly return backface / frontface hits
Tested in FortGPUTestBed and Fornite, but didn't notice any issues introduced by plane hack removal. If something breaks, then anyway we should fix it in the tracing code by improving non uniform SDF scale support there.
#rb Daniel.Wright
[CL 14571736 by Krzysztof Narkowicz in ue5-main branch]
DistanceField and MeshCards are not limited anymore to a single thread and can scale to the number of physical cores available
DistanceField and MeshCards are now both limiting their tick time length to avoid huge game-thread stalls when lots of assets are being built
Fix potential race-condition in DistanceFieldAsyncQueue found while fixing MeshCardAsyncQueue
#rb Alexis.Matte
[CL 14420000 by danny couture in ue5-main branch]