Commit Graph

224 Commits

Author SHA1 Message Date
Ryan Schmidt
623e4f96fe GeometryCore: create new GeometryCore Module. Move GeometricObjects code from GeometryProcessing plugin to this new module, as well as core FDynamicMesh3 classes (attributes, aabbtree/octree, change tracking). Update module Build.cs files that reference GeometricObjects.
#rb none
#rnx
#jira none
#preflight 60a713700569f300014a064a

[CL 16415082 by Ryan Schmidt in ue5-main branch]
2021-05-21 01:04:38 -04:00
ryan schmidt
6191a7ce3c ApproximateActors updates:
- FMeshSceneAdapter updates
   - if bThickenThinMeshes is enabled, then all instance meshes are converted to DynamicMesh and decomposed to find non-closed regions. Those regions are uniqued into separate meshes. The remaining closed geometry is separated out and kept as instanced.
   - various utility functions added to support above
   - previous code to explicitly 'thicken' open meshes into solids is removed. Instead unsigned distance is used to determine inside/outside and generate a 1/0 winding number
   - instances are now sorted into an octree to speed up winding number evaluations
   - If all meshes are closed (or effectively closed via above, ie will return integer winding number) then winding number query can early-out as soon as it finds a non-zero value
- Add hard-normals options in IGeometryProcessing_ApproximateActors (not exposed in MergeActors tool options yet)
- Added hard-normal callucation to ApproximateActorsImpl, and additional profiling
- Allow specification of actual  ECollisionTraceFlag options in CreateStaticMeshUtil, instead of just a boolean
- Add FSparseDynamicOctree3::ContainmentQueryCancellable() variant that can early-exit

#rb none
#rnx
#jira none
#preflight 60a686274c320300018d3841

#ROBOMERGE-SOURCE: CL 16410125 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16412542 by ryan schmidt in ue5-main branch]
2021-05-20 19:35:43 -04:00
semion piskarev
24e3ede218 Move IDynamicMeshProvider and IDynamicMeshCommitter out of the dynamic mesh module so that it can remain devoid of UThings. Add comments to avoid this in the future.
#rb Ryan.Schmidt
#jira none
#rnx

[CL 16388181 by semion piskarev in ue5-main branch]
2021-05-19 12:39:42 -04:00
ryan schmidt
d884513784 GeometryProcessing:
- Skip full-mesh normals computation in OffsetMeshRegion if using vertex normals.
- Add operator[] to MeshConnectedComponents.
- Add FSparseDynamicOctree3::ContainmentQuery() to allow for single-point range query.
- Add FMeshFaceSelection::IsSelectionBoundaryEdge() and optimize ExpandToOneRingNeighbours() and ContractBorderByOneRingNeighbours(), now significantly faster for very large selections. Convert VtxTrianglesItr calls to EnumerateVtxTriangles
- Use TestAnyHitTriangle() instead of FindNearestHitTriangle() in TRemoveOccludedTriangles. Reduces cost from 6.4s to 1.2s on a 64-core threadripper for a large-scale (1.4m triangles) visibility-based removal problem
- Optimize FMarchingCubes implementation for large thread counts. Replace single FCriticalSection with indexed sets of FCriticalSection to reduce thread contention. Instead of directly writing to mesh, accumulate mesh vertices and triangles in separate blocks (hashed on grid coordinates) and then build output mesh after generation completes. Add bEnableValueCaching option to skip caching of corner values, which causes lots of thread contention if Implicit function is very cheap (eg a grid-based SDF evaluation). Enable this option in Morphology meshing. Reduces marching cubes cost from ~3.5s to <500ms on a 64-core threadripper for a large-scale (1.4m triangles) Morphology problem.

#rb jimmy.andrews
#rnx
#jira none

#ROBOMERGE-SOURCE: CL 16370702 in //UE5/Private-Frosty/...
#ROBOMERGE-BOT: STARSHIP (Private-Frosty -> Main) (v804-16311228)

[CL 16372561 by ryan schmidt in ue5-main branch]
2021-05-18 14:33:08 -04:00
lonnie li
bbab3ea643 ModelingTools: 1st pass Mesh Texture bake refactor w/ multisampling support.
#rb tyson.brochu jimmy.andrews semion.piskarev michael.balzer
#rnx
#jira UETOOL-3397
#preflight 60a2b8b7292e3200011a6bf1

[CL 16357743 by lonnie li in ue5-main branch]
2021-05-17 16:01:01 -04:00
Ryan Schmidt
9defa23f46 GeometryProcessing:
- Add FImageAdapter, wraps TImageBuilder of different types and provides a consistent interface, so that other code doesn't need specializations for each image type
- FMeshSceneAdapter now supports the ability to detect and thicken "thin" meshes, by flattening the instances into unique mesh copies (generally necessary due to scaling). Can also now return statistics about the mesh scene, return a full flattened mesh (for debugging), and automatically generate a "closing mesh" that can help to cap off the base of mesh assemblies when trying to generate a solid/etc.

ModelingComponents:
- FWorldRenderCapture now writes via FImageAdapter instead of an Image4f
- FSceneCapturePhotoSet now stores less data for photo sets. BaseColor/Emissive/WorldNormal are 3f, Roughness/Specular/Metallic are 1f
- IApproximateActors and implementation now support optional base-capping, occluded mesh removal, geometric-tolerance simplification, thin mesh auth-thickening. Now creates MICs based on an input Material, instead of new Material. Added ability to emit a flattened debug mesh, and print debug info.

MergeActors:
- Expose above improvements to IApproximateActors

#rb none
#rnx
#jira none
#preflight 609ef005f6c6e3000144c5e2

[CL 16338550 by Ryan Schmidt in ue5-main branch]
2021-05-14 21:11:51 -04:00
Ryan Schmidt
bbc1c87e68 GeometryProcessing: optimize SweepingMeshSDF make_level_set3_parallel_floodfill() function. Replaced single full-grid lock with per-chunk locks to reduce lock contention. Also made per-chunk queues that are flattened into a single queue for the next iteration after each pass. Reduced cost of a large-distance morphology operation from 49s to 12s on a 64-core machine (where 7s of the remaining time is mesh generation). Instrument Morphology and SweepingMeshSDF with profiling macros.
#rb jimmy.andrews
#rnx
#jira none

[CL 16332823 by Ryan Schmidt in ue5-main branch]
2021-05-14 14:40:00 -04:00
Ryan Schmidt
6783e1ee61 GeometryProcessing:
Add FDynamicMeshEditor::AppendMesh() variant that takes a TTriangleMeshAdapter<double>
Add FMeshDescriptionMeshAdapterd that wraps FMeshDescriptionTriangleMeshAdapter in TTriangleMeshAdapter<double> API
Add TTransform3::HasNonUniformScale()
#rb david.hill
#rnx
#jira none
#preflight 609a0a570ba7b600013cce27

[CL 16278551 by Ryan Schmidt in ue5-main branch]
2021-05-11 15:50:30 -04:00
Ryan Schmidt
adf806112c GeometryProcessing: clean up check() that should be checkSlow() or ensure, to avoid hard failures when used at runtime
#rb david.hill
#rnx
#jira none
#preflight 6095784997897f0001945b4f

[CL 16245329 by Ryan Schmidt in ue5-main branch]
2021-05-09 18:14:45 -04:00
Andrew Davidson
3ddc3a4da3 Merge up from //UE5/Dev-LargeWorldCoordinates
#rb none

[CL 16211417 by Andrew Davidson in ue5-main branch]
2021-05-05 15:07:25 -04:00
Ryan Schmidt
e80d853a06 GeometryProcesing: add TImageBuilder::FastDownsample. Add AntiAliasMultiSampling parameter to ApproximateActors API and Impl. Expose WindingNumber parameter in ApproximateActors API. Modify FMeshSceneAdapter to compute winding number sum instead of max.
#rb none
#rnx
#jira none
#preflight 6091c88590631e000100c55b

[CL 16201057 by Ryan Schmidt in ue5-main branch]
2021-05-04 19:08:26 -04:00
lonnie li
72634ac81c GeometryProcessing: Fix "Remesh Test Case Meshes" unit test.
#rb jimmy.andrews
#rnx
#preflight 608c30ca3b0ce10001b3419c

[CL 16170506 by lonnie li in ue5-main branch]
2021-04-30 13:37:10 -04:00
lonnie li
226e13f24a GeometryProcessing: Fix RefCountVector unsigned short conversion errors.
Skip DynamicMesh Serialization Benchmark in regular tests.

#rb jimmy.andrews, michael.balzer
#rnx

[CL 16164448 by lonnie li in ue5-main branch]
2021-04-29 22:03:27 -04:00
lonnie li
4112dc46ed GeometryProcessing: DynamicMesh serialization support
#rb ryan.schmidt, semion.piskarev
#rnx
#jira none
#preflight 608aff3aa498c2000106517e

[CL 16161173 by lonnie li in ue5-main branch]
2021-04-29 16:01:21 -04:00
Ryan Schmidt
80a4dcfb0d GeometryProcessing: add basic ImageInfilling implementation and World-Position-Based Color/Normal Bakers
#rb none
#rnx
#jira none

[CL 16157857 by Ryan Schmidt in ue5-main branch]
2021-04-29 11:43:08 -04:00
Ryan Schmidt
f99091e243 GeometryProcessing: add basic TTransformSequence3, allows storing multiple separate transforms in list, transforming points
ModelingComponents: add FMeshSceneAdapter, generates "flattened" mesh representation for a set of Actors, with support for instancing to avoid duplication, and creates minimal set of AABBTree/FWNTrees for the unique meshes. Does not make copies of any mesh data, uses MeshAdapter to allow queries directly on MeshDescriptions.
#rb none
#rnx
#jira none

[CL 16148184 by Ryan Schmidt in ue5-main branch]
2021-04-28 16:17:03 -04:00
Ryan Schmidt
0986d24da5 ModelingComponents: add support for capturing scene renders and doing photo-based texturing
- new FWorldRenderCapture class can capture various render buffers of a set of Actors from a given 3D camera
- new TSpatialPhoto represents a 3D-oriented 2D image (ie a "photo")
- new TSpatialPhotoSet stores a set of photos and supports quering them for an attribute value "seen by" the photo set at an arbitrary 3D position (eg basically photo-reprojection onto the point)
- new FSceneCapturePhotoSet calculates TSpatialPhotoSet for a set of render attributes using FWorldRenderCapture, and then supports querying to effectively texture a 3D point using the Photo Set
- FTexture2DBuilder now knows about various other texture types, clarified SRGB conversion parameters
#rb none
#rnx
#jira none

[CL 16135423 by Ryan Schmidt in ue5-main branch]
2021-04-27 21:11:58 -04:00
Ryan Schmidt
6fddf37b78 GeometryProcessing updates for new MergeActors method:
- Add ECorrespondenceStrategy enum/setting to FMeshImageBakingCache to allow for different lowpoly/highpoly mapping polices, and implement those various policies. Add  FindSamplingHoles() to allow for image postprocessing to repair sampling failures.
- Add TImateBuilder::ContainsPixel()
- Add TMathUtil::Tan() function wrapper
- Add support for "Build Scale" in FMeshDescriptionTriangleMeshAdapter. StaticMesh MeshDescriptions can have an arbitrary scaling factor applied, this allows incorporating that scaling without having to make a mesh copy (at cost of a multiply for each vertex access). Add Vectortype-templated GetTriVertices() function.
- Add FWindingNumberBasedSolidify variant of TImplicitSolidify that supports an external Winding-Number-Like function, and does not have an explicit Mesh/AABBTree dependency. This allows us to mesh the winding number an arbitrary assembly of objects.
#rb david.hill
#rnx
#jira none

[CL 16133947 by Ryan Schmidt in ue5-main branch]
2021-04-27 18:23:26 -04:00
Ryan Schmidt
12bbe6b2eb GeometryProcessing: workaround for FAxisAlignedBox3d::Empty().Extents() result failing NaN check in LWC FVector3. If the mesh has no triangles, the box will never be used, so we don't need to use Empty() box. This does not resolve the larger issue, though.
#rb none
#rnx
#jira UE-113903
#fyi jonathan.bard

[CL 16084790 by Ryan Schmidt in ue5-main branch]
2021-04-21 20:54:36 -04:00
Ryan Schmidt
5f421e9890 GeometryProcessing: TVector4 operator!= now computes correct result
#rb none
#rnx
#jira none

[CL 16054456 by Ryan Schmidt in ue5-main branch]
2021-04-19 15:59:47 -04:00
Jimmy Andrews
7be064bbde Change ParallelFor calls in geometry imageoccupancymap to be per-row to account for int32 index type
#rb david.hill
#rnx
#preflight 607486320adbfb0001e1fc3c

[CL 15980635 by Jimmy Andrews in ue5-main branch]
2021-04-12 14:39:23 -04:00
Jimmy Andrews
9c0a06fd6d less roundabout SetPixel in GeometricObjects' ImageBuilder
#rb david.hill
#rnx
#preflight 6074865fff56130001c1e1ef

[CL 15980435 by Jimmy Andrews in ue5-main branch]
2021-04-12 14:32:53 -04:00
Marc Audy
01b7c9f4f5 Merge UE5/RES @ 15958325 to UE5/Main
This represents UE4/Main @ 15913390 and Dev-PerfTest @ 15913304

[CL 15958515 by Marc Audy in ue5-main branch]
2021-04-08 14:32:07 -04:00
jimmy andrews
18fb9e2756 add an "IndexOf" to FIndex4i
#rb none
#rnx

#ROBOMERGE-SOURCE: CL 15892400 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15892408 by jimmy andrews in ue5-main branch]
2021-04-01 14:13:15 -04:00
jimmy andrews
b72a25971e Fix geometry TVector4's One() to return the correct type
#rb trivial
#rnx
#preflight 6065fa66c5a3a10001f94c77

#ROBOMERGE-SOURCE: CL 15891714 in //UE5/Release-5.0-EarlyAccess/...
#ROBOMERGE-BOT: STARSHIP (Release-5.0-EarlyAccess -> Main) (v786-15839533)

[CL 15891763 by jimmy andrews in ue5-main branch]
2021-04-01 13:45:36 -04:00