Commit Graph

349 Commits

Author SHA1 Message Date
christopher waters
c45f1dfad5 Removing Tessellation:
- Removed Tessellation settings from Materials and Material Interfaces
- Removed Adjacency buffers from Static and Skeletal Meshes.

#jira UE-94564
#rb jeremy.moore, josie.yang, kevin.ortegren, yuriy.odonnell

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

[CL 15502653 by christopher waters in ue5-main branch]
2021-02-23 14:03:21 -04:00
krzysztof narkowicz
e9ca31e797 LumenScene refactor
* 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]
2021-02-22 18:04:23 -04:00
danny couture
6929adbfaa Skeletal Mesh Async Compilation Framework (Phase 1)
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]
2021-02-18 11:19:19 -04:00
Richard TalbotWatkin
bf10d3336a Refactor of source model representation for static meshes.
- 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]
2021-02-16 15:14:02 -04:00
krzysztof narkowicz
8e87b8ba2b Lumen - tighten surface cache projections to save a bit of atlas space and remove empty borders causing incorrect radiosity upsampling
[FYI] Patrick.Kelly

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

[CL 15392790 by krzysztof narkowicz in ue5-main branch]
2021-02-11 17:59:41 -04:00
danny couture
d5ba6e94d9 Remove BackgroundPriority to let the ParallelFor auto select the best priority depending on which thread is launching the paralllelfor
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]
2021-02-11 11:01:47 -04:00
Arne Schober
5fdfd0099d U5 - Move FMeshDistanceFieldAsyncTask in parallelFor
[CL 15373180 by Arne Schober in ue5-main branch]
2021-02-09 20:52:00 -04:00
JeanFrancois Dube
0981e2c2fe Optim: reserve proper array size in FSkeletalMeshUtilityBuilder::GenerateSkeletalRenderMesh to avoid unrequired memory allocations.
#rb danny.couture

[CL 15337177 by JeanFrancois Dube in ue5-main branch]
2021-02-05 09:37:19 -04:00
Marc Audy
cac1fe0019 Merge UE5/Release-Engine-Staging @ CL# 15299266 to UE5/Main
This represents UE4/Main @ CL# 15277572

[CL 15299962 by Marc Audy in ue5-main branch]
2021-02-03 14:57:28 -04:00
Arne Schober
f6e1fb0d86 U5 - have MeshDistanceFields BusyWait and not take down all Task Workers.
[CL 15288899 by Arne Schober in ue5-main branch]
2021-02-02 21:18:43 -04:00
Josh Adams
b0e4357576 - UBT Code changes to remove 32-bit Windows support (C++ code for 32-bit still exists)
#rb marc.audy (concept, not each file)

[CL 15265424 by Josh Adams in ue5-main branch]
2021-01-31 15:09:58 -04:00
Krzysztof Narkowicz
bef7aa2a1e Fixed Lumen card representation for thin planes, where decals were too thin to be picked up for projection
#fyi Daniel.Wright

[CL 15169798 by Krzysztof Narkowicz in ue5-main branch]
2021-01-23 01:26:01 -04:00
Marc Audy
bc88b73a29 Merge Release-Engine-Staging to Main @ CL# 15151250
Represents UE4/Main @ 15133763

[CL 15158774 by Marc Audy in ue5-main branch]
2021-01-21 16:22:06 -04:00
Krzysztof Narkowicz
6c573a2474 Lumen surface cache now supports internal surfaces
* 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]
2021-01-20 11:34:55 -04:00
Daniel Wright
e5b3986253 Mesh Distance Field supports Two Sided materials properly, when assigned to the asset
[CL 14945194 by Daniel Wright in ue5-main branch]
2020-12-17 00:02:25 -04:00
Alexis Matte
73d83c6a38 To protect the skeletalmesh when using async operations like build or re-import we deprecate all public member variables of USkeletalMesh class and create the necessary getter and setter. Those member will stay public but will be move to private in a future release.
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]
2020-11-25 11:17:08 -04:00
Krzysztof Narkowicz
14d02c6809 MeshSDF - implemented a tight bounding box with one voxel margin for bilinear gradient reconstruction. This allowed the MESH_SDF_APPROX_MARGIN hack to be removed and secured all gradient reconstruction operations from reading outside of valid bounds. Also saved ~50% of SDF atlas space, and speed up some mesh SDF operations:
UpdateGlobalDistanceField: ~7% faster
TraceMeshSDFs: ~5% faster

#rb Daniel.Wright, Patrick.Kelly

[CL 14618591 by Krzysztof Narkowicz in ue5-main branch]
2020-10-29 23:43:01 -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
danny couture
0b151ec30f Deprecate some directly accessible fields in UStaticMesh
#rb Francis.Hurteau

[CL 14606505 by danny couture in ue5-main branch]
2020-10-28 22:08:44 -04:00
Krzysztof Narkowicz
2921126a39 SDF and card rep generation now check for degenerate triangles before adding them to the Embree scene
#rb Daniel.Wright

[CL 14579820 by Krzysztof Narkowicz in ue5-main branch]
2020-10-26 15:07:53 -04:00
Krzysztof Narkowicz
3da3a205fb Added FMeshBuilder::BuildMeshVertexPositions. It replaces FMeshBuilder::BuildMesh(bool bBuildOnlyPosition = true) and does the minimal work which is required to extract vertex positions from a mesh descriptor.
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]
2020-10-26 13:09:34 -04:00
Krzysztof Narkowicz
6a3e844487 Mesh distance field generation fixes:
* 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]
2020-10-25 23:29:54 -04:00
Marc Audy
4c1bb11c29 Merge UE5/Release-Engine-Staging to UE5/Main @ 14548662
This represents UE4/Main @ 14525125 + cherrypicked fixes
#skipundocheck

[CL 14551026 by Marc Audy in ue5-main branch]
2020-10-22 19:19:16 -04:00
danny couture
6e8494009d DistanceField and MeshCards async queues are now reusing existing threadpool instead of spawning their own
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]
2020-10-05 08:22:37 -04:00
Marcus Wassmer
3b81cf8201 Merging using //UE5/Main_to_//UE5/Release-Engine-Staging @14384769
autoresolved files
#rb none

[CL 14384911 by Marcus Wassmer in ue5-main branch]
2020-09-24 00:43:27 -04:00