Commit Graph

360 Commits

Author SHA1 Message Date
ryan schmidt
d205e117bb GeometryProcessing: various utility functions to assist with rounded bevels implementation
- add 2D version of VectorTanHalfAngle to VectorUtil.h
- add FDynamicMeshUVEditor::SetToPerVertexUVs, initializes overlay to have a single UV for each vertex
- add FQuadGridPatch::InitializeFromQuadPatch(), initializes the quad grid from external rows of quads and associated vertices
- add FQuadGridPatch::GetVertexColumn(), returns the list of vertices in a specific grid column
- add FQuadGridPatch::FindColumnIndex(), finds the index of the grid column that contains a specific Vertex ID
#rb rinat.abdrashitov

[CL 30166232 by ryan schmidt in ue5-main branch]
2023-12-06 15:32:17 -05:00
jimmy andrews
709a94dbbd Add a method to remove unused vertices from a dynamic mesh, and expose it to geometry script
#rb tyson.brochu

[CL 30048365 by jimmy andrews in ue5-main branch]
2023-12-01 14:14:28 -05:00
jimmy andrews
b2f3167702 put the exact triangle intersection find-segments branch in an 'else' to prevent the compiler from complaining about unreachable code when it takes the other constexpr if branch
#rb rinat.abdrashitov

[CL 29966777 by jimmy andrews in ue5-main branch]
2023-11-28 14:36:08 -05:00
jimmy andrews
bf3ae9cbd2 better simple collision level set visualization: add optional marching-cubes-based level set triangulation to the simple-collision->mesh utility functions and use the new marching cubes triangulation in tools + optionally in geometry script's append simple collision function.
also do some cleanup / generalization of the utility functions and change geometry script's append simple collision function to use them.

#rb David.Hill

[CL 29763193 by jimmy andrews in ue5-main branch]
2023-11-15 18:04:18 -05:00
charles bloom
108b030948 Texture preventative fixes; clarify some mip locking code and fix 64 bit issues
#rb fabian.giesen
#rnx

[CL 29759416 by charles bloom in ue5-main branch]
2023-11-15 16:30:26 -05:00
jimmy andrews
d0ca302cab in convex decomposition helper function, fix mismatch between parameters listed in comment and actual parameters in method
#rb matija.kecman

[CL 29521381 by jimmy andrews in ue5-main branch]
2023-11-07 10:54:19 -05:00
jimmy andrews
f55e6088b8 Add support for negative space protection in the 'splitting' part of the convex decomposition algorithm + associated initialization / support functions
#rb matija.kecman

[CL 29498286 by jimmy andrews in ue5-main branch]
2023-11-06 15:40:07 -05:00
jimmy andrews
78d8ab4884 deprecate convex decomposition's negative space compute's assumption of default-flipped triangle orientations by making the triangle orientation an explicit function parameter (rather than a settings struct member) and deprecating the old function w/out this parameter.
#rb matija.kecman

[CL 29321127 by jimmy andrews in ue5-main branch]
2023-11-01 12:20:40 -04:00
jimmy andrews
609a443699 Fix performance and memory issues when merging a large number of collision shapes:
- More aggressively prune the cache of computed merge shapes after it reaches a threshold size
 - By default compute a proximity graph based on actual proximity, not the full n^2 possible connections
 - After finding the best of a number of possilbe merges, optionally only look for local improvements to the current best rather than doing a full search for the absolute best connection.

#rb david.hill, shaun.kime

[CL 29158488 by jimmy andrews in ue5-main branch]
2023-10-26 20:24:56 -04:00
don boogert
b9b8d95175 Landscape: Use PointHashGrid2 to weld coincident points
* Removed old ExportToRawMesh function and CVar `landscape.Nanite.MarchingSquaresVisibility`
* Make Landscape Nanite build less noisey in the logs
* GeometryCore - Added Reserve to TPointHashGrid2 (to match TPointHashGrid3)

#jira UE-194086
#rb jonathan.bard

[CL 29025960 by don boogert in ue5-main branch]
2023-10-23 21:04:53 -04:00
jimmy andrews
4990e4f977 fix geometrycore Polygon2::Simplify's handling of case when initial close-point-removal reduces polygon to two points
#rb rinat.abdrashitov

[CL 28879780 by jimmy andrews in ue5-main branch]
2023-10-18 12:05:48 -04:00
jimmy andrews
dcdd199f26 expose out convex decomposition negative space's voxel search 'min voxels per dimension' parameter to the setting structs, rather than hardcoding it as 128
#rb tyson.brochu

[CL 28877619 by jimmy andrews in ue5-main branch]
2023-10-18 11:04:33 -04:00
jimmy andrews
f3260123e2 add outer-only negative space sampling via continuation marching cubes
#rb tyson.brochu, rinat.abdrashitov

[CL 28771065 by jimmy andrews in ue5-main branch]
2023-10-13 16:45:04 -04:00
jimmy andrews
b3a1a9c3c2 support custom early-out overlap queries for sparse dynamic octree, and early-out Enumerate functions on SmallListSet and SparseListSet to support this
#rb david.hill

[CL 28687632 by jimmy andrews in ue5-main branch]
2023-10-11 18:26:55 -04:00
jimmy andrews
dfb07a973a Add geometry script 'approximate convex hulls with simpler collision shapes' function, to optionally replace convex hulls with spheres or boxes
#rb david.hill

[CL 28687462 by jimmy andrews in ue5-main branch]
2023-10-11 18:25:00 -04:00
jimmy andrews
2b6859997b Add geometry script collision functions for converting sphere coverings to/from sphere arrays, to support manually creating/adjusting negative space
#rb david.hill

[CL 28680876 by jimmy andrews in ue5-main branch]
2023-10-11 16:27:36 -04:00
jimmy andrews
793ef9a727 Add angle-tolerance method of convex hull simplification to the geometry script convex hull simplify options
Add a face normal clustering function that returns the vertices at corners of the clusters (vertices touching at least 3 different clusters), for use in the angle-tolerance convex hull simplification method

#rb rinat.abdrashitov

[CL 28467181 by jimmy andrews in ue5-main branch]
2023-10-04 14:29:39 -04:00
jimmy andrews
edc21b808e Add a normal-based clustering algorithm which groups connected triangle groups based on the current average normal of the group.
Use this algorithm in the polygroups generator tool, so we get more useful groups on smooth surfaces (like a cylinder)

Also add a helper to the FSizedDisjointSet class to easily get the number of groups in the set and a mapping between compact group indices and sparse group IDs

#rb david.hill

[CL 28433389 by jimmy andrews in ue5-main branch]
2023-10-03 17:20:18 -04:00
jimmy andrews
6688c1703d add cbrt (cube root) function to mathutil
#rb matija.kecman

[CL 28386084 by jimmy andrews in ue5-main branch]
2023-10-02 14:06:11 -04:00
jimmy andrews
ced12de0f4 Add negative space protection to the geometry script collision merging algorithm
#rb david.hill

[CL 28234875 by jimmy andrews in ue5-main branch]
2023-09-26 12:59:58 -04:00
jimmy andrews
2d32fa2e5f Add a MergeSimpleCollisionShapes function to Geometry Script, which can reduce the number of simple collision shapes by merging them. Currently works via convex hull merging, so merged shapes will always be convex hulls, but shapes that are not merged will be left with their original type.
Add a 'source ID' concept to the convex part decomposition, to enable tracking of which hulls were not merged to any other hulls when running the convex hull merging algorithm.

#rb rinat.abdrashitov

[CL 28106868 by jimmy andrews in ue5-main branch]
2023-09-21 17:12:08 -04:00
bryan sefcik
34b5c4034a Updated Clip and DoClipping to be forceinlined. This saved roughly 100ms from calling functions on average. Overall it saved 8secs on average when generating from **Model assets.
#jira

[CL 28065851 by bryan sefcik in ue5-main branch]
2023-09-20 19:31:05 -04:00
jimmy andrews
f12520cfcf Add a new k-DOP fitting algorithm to GeometryCore and swap it in to GeomFitUtils so it will be used by the Static Mesh Editor.
#rb rinat.abdrashitov
#rb richard.talbotwatkin
#jira UE-194152

[CL 28048380 by jimmy andrews in ue5-main branch]
2023-09-20 14:46:30 -04:00
jimmy andrews
ce33cacf43 Move TConvexHull3 simplification-related settings to a separate struct, to make it easier to manage these settings (inside the convex hull code and also for other classes that call into it, like convex decomposition)
Note: These settings were all introduced post-5.3, so moving them should not require deprecation

#rb rinat.abdrashitov

[CL 27715888 by jimmy andrews in ue5-main branch]
2023-09-08 12:43:50 -04:00
xuelongmu
845f05d3aa PR #10364: Migrate to new Distance method
#jira UE-183754
#rb jimmy.andrews

[CL 27712607 by xuelongmu in ue5-main branch]
2023-09-08 11:26:29 -04:00