Commit Graph

169 Commits

Author SHA1 Message Date
Jimmy Andrews
ec5013e106 change FArrangement2d and TConstrainedDelaunay2 to use new FDelaunay2 code for triangulations
#rb david.hill
#preflight 6247dfee3a5a4c1622eb077b

[CL 19628412 by Jimmy Andrews in ue5-main branch]
2022-04-05 14:07:13 -04:00
Jimmy Andrews
4f0c122342 Add optional error tolerances to guide convex decomposition
#rb tyson.brochu
#preflight 62465633df7d23dbfe12e1f7

[CL 19582884 by Jimmy Andrews in ue5-main branch]
2022-03-31 21:49:52 -04:00
Jimmy Andrews
9d14bf8718 Initial version of a convex decomposition algorithm
Works by trying a bunch of plane cuts to break reduce the volume of the convex pieces, then merging them back together to remove those that were not helpful.  We need the merge step especially for meshes where it takes multiple plane cuts to start reducing the hull volumes, as the initial cuts in that case are not informed by the error metric.

#rb tyson.brochu
#rb matija.kecman
#preflight 624614b1b6084b98324d2059

[CL 19578614 by Jimmy Andrews in ue5-main branch]
2022-03-31 17:09:04 -04:00
frederic doll
f5701545f8 Fix for AABB FindIntersection with ray : fill the RayParamOut value to be able to get the intersection point
#rb jimmy.andrews

#ROBOMERGE-AUTHOR: frederic.doll
#ROBOMERGE-SOURCE: CL 19557359 via CL 19557368 via CL 19557404 via CL 19557417
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v937-19513599)

[CL 19561882 by frederic doll in ue5-main branch]
2022-03-30 14:52:23 -04:00
tyson brochu
768cfab5db Add scalar weight maps to DynamicMeshAttributeSet
- Allow the Attribute Editor Tool to add/delete weight maps from DynamicMesh targets.
- Enable transferring scalar weight maps back and forth between DynamicMesh and MeshDescription.
- Serialize TDynamicAttributeBase::Name when its subclasses are serialized

#rb nathan.mitchell
#preflight 62439b2ab6084b9832307f6e

[CL 19551734 by tyson brochu in ue5-main branch]
2022-03-29 20:04:24 -04:00
Jimmy Andrews
271266b464 Add a vertex-based connected components class that can be used with any TriangleMeshType and supports connecting based on spatial proximity as well as triangle topology
#rb matija.kecman
#preflight 6241d7cc5e39ec66db053828

[CL 19529088 by Jimmy Andrews in ue5-main branch]
2022-03-28 12:26:04 -04:00
Jimmy Andrews
dc806da34f Delaunay triangulation algorithm improvements:
- fix bug with detection of vertices on the solid segment of a ghost triangle
 - detect when 'fill' of a triangulation is ambiguous under winding rules (e.g. due to open edges)
 - optionally automatically track duplicate vertices and remap duplicate-vertex references to the vertex that was actually inserted

#rb rinat.abdrashitov
#preflight 623e11a9982d12a89973cdec

[CL 19521151 by Jimmy Andrews in ue5-main branch]
2022-03-25 23:09:50 -04:00
Jimmy Andrews
bc4f091865 Expose optional second importance weight to the FPriorityOrderPoints class
#rb rinat.abdrashitov
#preflight 623e11818330d27ee37434d4

[CL 19519241 by Jimmy Andrews in ue5-main branch]
2022-03-25 18:00:27 -04:00
Jimmy Andrews
86b896a04a update new Delaunay code to be more usable:
- Report failures to constrain edges, optionally detecting the case where the edge was flipped away by a subsequent constraint (happens if the constraint edges intersect)
 - Add options to directly triangulation TPolygon2 and TGeneralPolygon2 (+ the supporting fill algorithms to be run on any array of edges)
 - Add validation of Delaunay property for CDTs on all non-constrained edges
 - Update edge cache (if enabled) on sub-triangulation append, improving perf on CDTs with many constrained edges

add corresponding test coverage, and change the test runner to always automatically run exact predicates globalinit

#preflight 62321d0fe2541b4ff3b35efd
#rb rinat.abdrashitov

[CL 19408363 by Jimmy Andrews in ue5-main branch]
2022-03-16 13:44:59 -04:00
Jimmy Andrews
ea5e78a8e0 fix exact predicate test failures -- use volatile for INEXACT to force rounding
#preflight 622fce37ce577e3ab2e0b680

[CL 19380794 by Jimmy Andrews in ue5-main branch]
2022-03-14 20:24:15 -04:00
jimmy andrews
6b870db4fe Fix convex hull crashes (due to zero points and due to exact predicate failure)
add geometry processing low level test coverage for both cases

#jira UE-145703
#preflight 622fa7be306f46da14592f0b
#rb tyson.brochu
#lockdown simon.tourangeau

#ROBOMERGE-OWNER: jimmy.andrews
#ROBOMERGE-AUTHOR: jimmy.andrews
#ROBOMERGE-SOURCE: CL 19378695 in //UE5/Release-5.0/... via CL 19380177
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19380762 by jimmy andrews in ue5-main branch]
2022-03-14 20:15:28 -04:00
Jimmy Andrews
b885b54c1d new Delaunay triangulation code using robust predicates
Much faster and usable from non-plugin code

#rb rinat.abdrashitov
#rb tyson.brochu
#preflight 622a6e9632749f363c5a22ba

[CL 19341780 by Jimmy Andrews in ue5-main branch]
2022-03-10 16:41:30 -05:00
Jimmy Andrews
7c0aec7d1e Add a 'contain(other interval)' function to TInterval1
#rb semion.piskarev
#preflight 62291fd66360b4051cc5e9b1

[CL 19326407 by Jimmy Andrews in ue5-main branch]
2022-03-09 17:10:08 -05:00
Jimmy Andrews
46ea937c73 make convex hull code work directly with floats if the input is in floats, rather than converting everything to doubles
#rb tyson.brochu
#preflight 622905196e026fc824ab3a4e

[CL 19326164 by Jimmy Andrews in ue5-main branch]
2022-03-09 16:45:56 -05:00
Jimmy Andrews
a624095d22 Add a ZOrderCurve class to order points such that adjacent points in the ordering are likely to be close in space, to be used for incremental Delaunay construction (but can be useful in other algorithms too)
#rb rinat.abdrashitov
#preflight 6227b36d7934051162f05962

[CL 19309261 by Jimmy Andrews in ue5-main branch]
2022-03-08 15:08:31 -05:00
Jimmy Andrews
4b4a4c2d3c Exact Predicates improvements:
- Support InCircle
 - Support float as well as double
 - Add safer, templated versions that specify whether float or double is to be used (for TVector/TVector2)

#rb rinat.abdrashitov
#preflight 62277e1e7077eb04cf6db63d

[CL 19309153 by Jimmy Andrews in ue5-main branch]
2022-03-08 15:01:31 -05:00
ryan schmidt
7c983b8d45 GeometryCore: clean up issues that block non-LWC builds
#rb david.hill
#preflight 620ff48d53204823ae859ccb

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19064974 via CL 19076437 via CL 19077315 via CL 19078956
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19122734 by ryan schmidt in ue5-main branch]
2022-02-24 15:01:41 -05:00
semion piskarev
75e604f6a8 MeshModelingTools: Added comments clarifying things related to FDynamicMesh3, particularly role of per-vertex attributes.
#rb Ryan.Schmidt, Jimmy.Andrews
#jira none
#preflight 62164be40f71e491ccfc2d3c

[CL 19091339 by semion piskarev in ue5-main branch]
2022-02-23 10:09:22 -05:00
ryan schmidt
d948840611 GeometryCore: improve thread utililization in parallel continuation Marching Cubes
#rb david.hill, jimmy.andrews
#jira UE-142582
#preflight 620bd75e615db7478d33eaf1
#rnx
#lockdown aurel.cordonnier

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 19058443 in //UE5/Release-5.0/... via CL 19074160
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19076422 by ryan schmidt in ue5-main branch]
2022-02-22 13:45:48 -05:00
steve robb
1cdce38e89 Fix for mismatched deprecation macros.
#rb julien.marchand
#jira UE-140368
#preflight 620bd18c475fb819ddc57c82
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 18999801 in //UE5/Release-5.0/... via CL 19000202 via CL 19000472
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 19001966 by steve robb in ue5-main branch]
2022-02-15 15:11:48 -05:00
steve robb
a8c1e02c4e Use a union-based representation for types which want to treat its members as both individual named fields and as an array, to avoid strict aliasing issues.
#jira UE-140368
#preflight 6201d6b1e9567e66732291b2
#rb jeff.newquist
#lockdown julien.marchand

#ROBOMERGE-AUTHOR: steve.robb
#ROBOMERGE-SOURCE: CL 18995739 in //UE5/Release-5.0/... via CL 18996215 via CL 18996642
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 19001153 by steve robb in ue5-main branch]
2022-02-15 14:42:20 -05:00
ryan schmidt
b4814d732d ApproximateActors: reduce memory footprint by using compressed or lower-resolution LOD0 meshes
- add FStaticMeshLODResourcesAdapter in MeshConversions module, wrapper that presents StaticMesh LODResources mesh (ie Section buffers) with an API compatible with GeometryCore mesh templates
- add TMeshWrapperAdapterd in GeometryCore, this is a shim for getting any template-API-compatible mesh into a FTriangleMeshAdapterd specifically (required to call some non-template mesh processing functions)

- add support for using StaticMesh LODResources meshes in FMeshSceneAdapter instead of source meshes, controlled by build options flag
- add FMeshSceneAdapter build options flags specifying whether UV/Normal queries are required (default true)
  - when not required, the loaded MeshDescriptions and created DynamicMeshes are packed into FColliderMesh which has a smaller memory footprint, allowing the larger meshes to be freed

- to support above, the SpatialWrappers in MeshSceneAdapter.cpp have been refactored extensively
  - added FCompressedMeshSpatialWrapper which Builds from a temporary FDynamicMesh3 into a FColliderMesh, supports all the same options as FDynamicMeshSpatialWrapper (so a drop-in replacement with less memory usage, but no UV/Normal queries)
  - added FBaseMeshSpatialWrapper, base class for existing FDynamicMeshSpatialWrapper and new FCompressedMeshSpatialWrapper that has shared config settings (can more more here in the future)
  - added FStaticMeshLODResourcesMeshSurfaceAdapter, similar toFMeshDescriptionTriangleMeshSurfaceAdapter, a mesh adapter that filters out any geo that doesn't have a Surface-domain material
  - refactored TStaticMeshSpatialWrapper into TStaticMeshSpatialWrapperBase and subclasses FStaticMeshSourceDataSpatialWrapper and FStaticMeshRenderDataSpatialWrapper, for source mesh vs render mesh
  - added FCompressedStaticMeshSpatialWrapper, variant of FStaticMeshSourceDataSpatialWrapper that stores to a FColliderMesh and releases the source MeshDescription
  - SpatialWrapperFactory() now has logic to build from render mesh vs source mesh vs compressed source mesh
  - moved initial SpatialWrapper construction from AddActors() phase to Build() phase, because now it depends on build settings

- add EMeshDataSourceLODPolicy to IGeometryProcessing::FOptions, with LOD0 Source and LOD0 RenderMesh options
- ApproximateActorsImpl now provides/handles this policy setting, and configures FMeshSceneAdapter to not need UV/Normal queries (not required in this context)
- add bUseRenderLODMeshes option in FMeshApproximationSettings to expose render vs source mesh control at user level

#rb sebastien.lussier, rinat.abdrashitov
#jira UE-141256
#preflight 6206db44054c2e38c473be5d
#rnx

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18963126 in //UE5/Release-5.0/... via CL 18963829 via CL 18964587
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v917-18934589)

[CL 18964607 by ryan schmidt in ue5-main branch]
2022-02-11 18:11:49 -05:00
ryan schmidt
d70294ddfa GeometryCore: do not hold onto intermediate grid in two-pass computations in TImplicitMorphology. The first-pass grid is not used in the second pass, and having both grids allocated simultaneously results in significantly more peak memory allocated during large-grid computations (possibly resulting in OOMs)
#rb david.hill
#rnx
#jira UE-141256
#preflight 62015087384d6a94e8d1f1d4
#lockdown aurel.cordonnier

#ROBOMERGE-AUTHOR: ryan.schmidt
#ROBOMERGE-SOURCE: CL 18887855 in //UE5/Release-5.0/... via CL 18887872 via CL 18887998
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18888039 by ryan schmidt in ue5-main branch]
2022-02-07 13:03:15 -05:00
michael balzer
826fff9aa7 GeometryCore: Fix compilation error in TDynamicVector
#jira UE-141559
#preflight 61fdb3c9e65336d14554a6d4, 61fdb595cc13ffbd10f484c1
#rb trivial
#lockdown aurel.cordonnier

#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 18879758 in //UE5/Release-5.0/... via CL 18879764 via CL 18879799
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18884827 by michael balzer in ue5-main branch]
2022-02-07 09:07:19 -05:00
michael balzer
e8c5a8d3b0 GeometryCore: Fix legacy serialization of TDynamicVector<> for LWC data types using double and bulk serialization
#jira UE-141220
#preflight 61fc73c2af01d3caef2aecf8, 61fc73ee5e1fd46228526912
#lockdown aurel.cordonnier
#rb lonnie.li

#ROBOMERGE-AUTHOR: michael.balzer
#ROBOMERGE-SOURCE: CL 18866726 in //UE5/Release-5.0/... via CL 18866736 via CL 18869232
#ROBOMERGE-BOT: UE5 (Release-Engine-Test -> Main) (v910-18824042)

[CL 18869339 by michael balzer in ue5-main branch]
2022-02-04 14:10:42 -05:00