Commit Graph

11 Commits

Author SHA1 Message Date
Zousar Shaker
77d13185b7 Copying //UE5/Dev-Cooker@14539516 to Main (//UE5/Main)
[CL 14539954 by Zousar Shaker in ue5-main branch]
2020-10-21 17:56:05 -04:00
Richard TalbotWatkin
4884bf9d9a First pass of MeshDescription API and format refactor.
- Removed hardcoded element type arrays (Vertices, Edges, Triangles etc.). Mesh element types can now be arbitrarily added, with any number of channels.
- Mesh element containers have a much leaner format; instead of sparse arrays, they are now represented by a simple bitarray, determining whether an index is used or not. Consequently, mesh topology is now entirely described with the attribute system, e.g. edge start and end vertices, triangle vertices, etc.
- Support added for attributes of arbitrary dimensions, e.g. float[4] or int[2].
- Support added for attributes which index into another mesh element container.
- Added FMeshElementIndexer: this is an efficient container for maintaining backward references from one element type to another; for example, edges have an attribute specifying which vertices are at each end (an attribute of type FVertexID[2]). With an indexer, it is possible to look up which edges contain a given vertex, even though this is not explicitly stored. Indexers are designed to do minimal allocations and update lazily and in batch when necessary.
- Added support for preserving UV topology in static meshes. UVs are now a first-class element type which may be indexed directly from triangles.
- Added the facility to access the underlying array in an attribute array directly.
- Triangles now directly reference their vertex, edge and UV IDs. Vertex instances are to be deprecated.
- Changed various systems to be triangle-centric rather than polygon-centric, as this is faster. Triangles are presumed to be the elementary face type in a MeshDescription, even if polygons are still supported. The concept of polygons will be somewhat shifted to mean a group of triangles which should be treated collectively for editing purposes.
- Optimised normal/tangent generation and FBX import.
- Deprecated EditableMesh, MeshEditor and StaticMeshEditorExtension plugins - these are to be removed, but they still have certain hooks in place which need removing.
#rb

[CL 13568702 by Richard TalbotWatkin in ue5-main branch]
2020-05-28 10:56:57 -04:00
ryan durand
0f0464a30e Updating copyright for Engine Runtime.
#rnx
#rb none


#ROBOMERGE-OWNER: ryan.durand
#ROBOMERGE-AUTHOR: ryan.durand
#ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870549 by ryan durand in Main branch]
2019-12-26 14:45:42 -05:00
bob tellez
c73d2c2adb #UE4 Large compile speed improvement. Moved ranged-based for implementations from global overloads to members of their respective classes. Compilers were spending a lot of time resolving these overloads in global space but do not have the same problem now that they are in the scope of the class. Measured to save 20-40% compile time on files in the engine that use range-based for.
#rb Steve.Robb


#ROBOMERGE-SOURCE: CL 4937033 via CL 4937037 via CL 4940541

[CL 4941867 by bob tellez in Main branch]
2019-02-07 20:59:02 -05:00
Ben Marsh
7598af0532 Update copyright notices to 2019.
#rb none
#lockdown Nick.Penwarden

[CL 4662404 by Ben Marsh in Main branch]
2018-12-14 13:41:00 -05:00
jeanluc corenthin
da6881d9d7 Copy CL #4392021
- Fixed crash when importing model thru VRED importer
  - Includes changes to StaticMeshBuilder.cpp made in CL #4369604

#jira UE-64152
#rb Yuriy.ODonnell, Richard.TalbotWatkins

#ROBOMERGE-SOURCE: CL 4407052 in //UE4/Release-4.21/...
#ROBOMERGE-BOT: RELEASE (Release-4.21 -> Release-Staging-4.21)

[CL 4407058 by jeanluc corenthin in Staging-4.21 branch]
2018-09-28 14:46:08 -04:00
Richard TalbotWatkin
24a2a24011 New attribute array API.
Fixed some flaws in the original API, deprecated various methods, and introduced some new features.
- Now attribute arrays are accessed via TAttributesRef or TAttributesView (and corresponding const versions). These value types hold references to attribute arrays, and individual elements can be accessed by their element ID and attribute index. Using a value type is safer than the previous method which required assignment to a const-ref (and not doing so would take a temporary copy of the attribute array).
- The attribute set has been totally flattened, so all attributes of different types are added to the same container. This greatly improves compile times, prevents attributes from being created with the same name but different types, and permits the view feature.
- The class hierarchy has changed to have generic base classes where possible with no particular ElementID type. This reduces the code footprint by no longer generating nearly identical copies of templated methods.
- A TAttributesView allows the user to access an attribute array by the type of their choosing, regardless of its actual type. For example, the Normal attribute may be registered with type FPackedVector, but accessed as if it was an FVector. This allows us to move away from very strong typing, and instead transparently store attributes of a more efficient size, while the user is not affected.
- A transient attribute flag has been added, to denote that a particular attribute should not be saved.
#rb none

[CL 4226081 by Richard TalbotWatkin in Dev-Editor branch]
2018-07-20 18:58:37 -04:00
projectgheist
27ae5afdcb PR #4726: Update copyright notices to 2018. (Contributed by projectgheist)
#rb none
#lockdown Nick.Penwarden

[CL 4070389 by Ben Marsh in Main branch]
2018-05-14 07:48:19 -04:00
Richard TalbotWatkin
f2e03cbd8c Further Linux build fixes.
#rb none

[CL 3902373 by Richard TalbotWatkin in Dev-Geometry branch]
2018-02-21 16:18:41 -05:00
Richard TalbotWatkin
1c06236042 Total revamp of mesh element attribute model.
Attributes now have a number of possible types (FVector, FVector4, FVector2D, float, int, bool, FName, UObject*) and are exposed as individual flat arrays, indexed by element ID. For example, vertex positions are essentially exposed as an array of FVector which can be directly accessed and modified. This has a number of advantages:
- It is completely extensible: new attributes can be created (even by a third party) and added to a mesh description without requiring a serialization version bump, or any change to the parent structures.
- This is more efficient in batch operations which deal with a number of mesh elements in one go.
- These attribute buffers can potentially be passed directly to third-party libraries without requiring any kind of transformation.
- The distinct types allow for a better representation of the attribute being specified, without invalid values being possible (cf representing a bool value in an FVector4).

Attributes also have default values, and a flags field which confers use-specific properties to them. Editable Mesh currently uses this to determine whether an attribute's value can be automatically initialized by lerping the values of its neighbours, as well as for identifying auto-generated attributes such as tangents/normals. This is desirable as it means that even unknown / third-party attributes can potentially be handled transparently by Editable Mesh, without requiring the code to be extended.

Certain higher-level operations in EditableMesh have been optimized to make full use of vertex instances where possible.
The welding/splitting of identical vertex instances has been removed from here, as the aim is to unify this with mesh utility code elsewhere.
Various bug fixes.

#rb Alexis.Matte

[CL 3794563 by Richard TalbotWatkin in Dev-Geometry branch]
2017-12-07 13:02:12 -05:00
Richard TalbotWatkin
4bd417f8e8 - Split off mesh description into its own class and engine module. The intention is this will be shared by other mesh objects as the source mesh format, rather than being part of UEditableMesh.
- Created new API for accessing mesh elements. They now allow a range-for iteration over element IDs, and a custom container type for elements.
- Beginnings of a new generic attribute system which supports different attribute value types. This provides SoA type attribute containers (so, for example, all vertex positions are held contiguously).
- Revisited polygon groups and materials. Materials are now handled like an attribute of polygon groups, and are represented by a string asset reference, and two slot names (user-given and imported). Added a new basic action to move a polygon from one group to another, and removed the 'assign material to polygon' action. A mesh can now have more than one polygon group with the same material.
- General refactoring and optimization.
#rb Mike.Fricker

[CL 3603104 by Richard TalbotWatkin in Dev-Geometry branch]
2017-08-22 16:18:25 -04:00