Commit Graph

14 Commits

Author SHA1 Message Date
Brian Karis
449bf07ce4 Fixed bug where single edge collapse removes all remaining triangles.
Deleted old simplifier

#rb graham.wihlidal
#preflight 647910245d23eca37db298ee

[CL 25745236 by Brian Karis in ue5-main branch]
2023-06-01 17:55:09 -04:00
Rune Stubbe
737c77422f Nanite support for explicit tangents
#jira UE-166732
#rb brian.karis
#fyi graham.wihlidal, jamie.hayes
#preflight 644f9d045403400548450480

[CL 25282711 by Rune Stubbe in ue5-main branch]
2023-05-01 07:48:12 -04:00
rune stubbe
dd0456959b Added nullptr check for File in FMeshSimplifier::DumpOBJ to make PVS studio happy (Issue: 219027)
[FYI] brian.karis, graham.wihlidal

[CL 22271649 by rune stubbe in ue5-main branch]
2022-09-30 11:32:18 -04:00
rune stubbe
698250487a Fixed compile errors in MeshSimplify.cpp
-Linux doesn't compile because fopen_s is not a standard function
-Missing include for Math/RandomStream.h

#preflight skip
[FYI] juan.canada, brian.karis, graham.wihlidal

[CL 22260785 by rune stubbe in ue5-main branch]
2022-09-29 20:32:27 -04:00
graham wihlidal
561e36e5c7 Nanite: Added "Preserve Area" checkbox to correct leaves disappearing on trees.
This aims to preserve the surface area during simplification. If area is lost, open boundary edges of the mesh are dilated to compensate. This is useful for foliage that tends to thin out in the distance if not enabled.

Also include misc fixes:
Collapses that completely remove disjoint triangles have an error of the area of what was removed.
Would not alias 0 and -0 verts due to binary comparison.

#rb graham.wihlidal
#preflight 63349e32141f314ed601978d

#ushell-cherrypick of 22229630 by Brian.Karis
#preflight 6334c401f418a1071a35b4a4

[CL 22260505 by graham wihlidal in ue5-main branch]
2022-09-29 20:24:18 -04:00
Richard TalbotWatkin
71be494d68 Fix for overflow error when simplifying large meshes.
#review-21293208 Brian.Karis
#preflight 6307897f37470da4bf38eb61

[CL 21564235 by Richard TalbotWatkin in ue5-main branch]
2022-08-25 10:46:43 -04:00
brian karis
0d8b010e12 Nanite displaced mesh. Added uniform tessellation and displacement.
#rb graham.wihlidal
#preflight 62901dcd74630984fd6763b1

#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 20400905 via CL 20400917 via CL 20400925
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v949-20362246)

[CL 20402444 by brian karis in ue5-main branch]
2022-05-27 20:42:29 -04:00
brian karis
dc4771ff54 Allow auto screen size for LODs to be over 1. This is required for high poly meshes where simplifying causes only a small deviation.
Change mesh simplifier settings to match closer to what they used to be to prevent large changes in LOD distances from ue4 to ue5.

#rb michal.valient
#jira UE-144622
#preflight 622bf219902b7ca699eb7c53

#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 19378057 in //UE5/Release-5.0/... via CL 19379381
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v926-19321884)

[CL 19379859 by brian karis in ue5-main branch]
2022-03-14 18:40:56 -04:00
brian karis
e838341c86 External edges now handle non-manifold meshes, ie multiple adjacency
Added Moore-Penrose pseudo inverse for solving singular quadrics. Disabled for now.

#rb rune.stubbe

#ROBOMERGE-AUTHOR: brian.karis
#ROBOMERGE-SOURCE: CL 18415437 in //UE5/Release-5.0/... via CL 18415438
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v897-18405271)

[CL 18415441 by brian karis in ue5-release-engine-test branch]
2021-12-08 20:32:07 -05:00
krzysztof narkowicz
74eafb9f84 Replace Nanite coarse proxy mesh constant min number of vertices with a target simplification error and range. This allows it to allocate more triangles towards complex meshes and less towards simple ones, greatly improving complex proxy quality without changing memory budget.
p_construct_wp
Old memory:
410.136MB BLAS
351.786MB StaticMesh Index Memory
290.267MB - StaticMesh Vertex Memory

New memory:
391.319MB  BLAS
357.895MB  StaticMesh Index Memory
291.738MB  StaticMesh Vertex Memory

Coarse mesh build times ~0.19s vs ~0.26s

#rb Brian.Karis
[FYI] Kenzo.Terelst
#preflight 610deeb40ccb8400012b505c

#ROBOMERGE-SOURCE: CL 17094507 via CL 17095865
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v853-17066230)

[CL 17095951 by krzysztof narkowicz in ue5-release-engine-test branch]
2021-08-07 15:49:52 -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
Brian Karis
d34a9f9ade Fix simplifier crash due to duplicate triangles. There were so many that a single edge collapse removed >100 triangles. Now checks for duplicates after every collapse so they don't accumulate.
#rb none

[CL 14811913 by Brian Karis in ue5-main branch]
2020-11-24 22:27:30 -04:00
Brian Karis
e1dab2c3a9 Fixed Nanite holes which were due to inversion penalty being scale only. When error is zero or near zero like an edge on a flat plane, triangle inversion is also likely and the penality for it doesn't help if it's a scale.
The reason why I switched from bias to scale was to put the penalities in the same relative spectrum of the collapses being considered. Degree should probably still be more like that but for now it's safer to just go back to what this was before.

[CL 14808423 by Brian Karis in ue5-main branch]
2020-11-23 20:45:39 -04:00
Michal Valient
95d19f95b1 [REVERB] Merging //UE4/Private-Reverb-Development@13832732
#rb graham.wihlidal, rune.stubbe, brian.karis, andrew.lauritzen, jeff.farris

[CL 13834854 by Michal Valient in ue5-main branch]
2020-07-06 18:58:26 -04:00