@@ -976,8 +976,8 @@ void meshlets(const Mesh& mesh, bool scan = false, bool uniform = false)
976
976
double avg_vertices = 0 ;
977
977
double avg_triangles = 0 ;
978
978
double avg_boundary = 0 ;
979
+ double avg_connected = 0 ;
979
980
size_t not_full = 0 ;
980
- size_t not_connected = 0 ;
981
981
982
982
std::vector<int > boundary (mesh.vertices .size ());
983
983
@@ -1022,16 +1022,17 @@ void meshlets(const Mesh& mesh, bool scan = false, bool uniform = false)
1022
1022
roots += follow (parents, j) == int (j);
1023
1023
1024
1024
assert (roots != 0 );
1025
- not_connected += roots > 1 ;
1025
+ avg_connected += roots;
1026
1026
}
1027
1027
1028
1028
avg_vertices /= double (meshlets.size ());
1029
1029
avg_triangles /= double (meshlets.size ());
1030
1030
avg_boundary /= double (meshlets.size ());
1031
+ avg_connected /= double (meshlets.size ());
1031
1032
1032
- printf (" Meshlets%c: %d meshlets (avg vertices %.1f, avg triangles %.1f, avg boundary %.1f, not full %d , not connected %d) in %.2f msec\n " ,
1033
+ printf (" Meshlets%c: %d meshlets (avg vertices %.1f, avg triangles %.1f, avg boundary %.1f, avg connected %.2f , not full %d) in %.2f msec\n " ,
1033
1034
scan ? ' S' : (uniform ? ' U' : ' ' ),
1034
- int (meshlets.size ()), avg_vertices, avg_triangles, avg_boundary, int (not_full) , int (not_connected ), (end - start) * 1000 );
1035
+ int (meshlets.size ()), avg_vertices, avg_triangles, avg_boundary, avg_connected , int (not_full ), (end - start) * 1000 );
1035
1036
1036
1037
float camera[3 ] = {100 , 100 , 100 };
1037
1038
@@ -1401,17 +1402,7 @@ void processDev(const char* path)
1401
1402
if (!loadMesh (mesh, path))
1402
1403
return ;
1403
1404
1404
- Mesh copy = mesh;
1405
- meshopt_optimizeVertexCache (©.indices [0 ], ©.indices [0 ], copy.indices .size (), copy.vertices .size ());
1406
- meshopt_optimizeVertexFetch (©.vertices [0 ], ©.indices [0 ], copy.indices .size (), ©.vertices [0 ], copy.vertices .size (), sizeof (Vertex));
1407
-
1408
- meshopt_encodeVertexVersion (0 );
1409
- encodeVertex<PackedVertex>(copy, " L" );
1410
- meshopt_encodeVertexVersion (1 );
1411
- encodeVertex<PackedVertex>(copy, " 0" , 0 );
1412
- encodeVertex<PackedVertex>(copy, " 1" , 1 );
1413
- encodeVertex<PackedVertex>(copy, " 2" , 2 );
1414
- encodeVertex<PackedVertex>(copy, " 3" , 3 );
1405
+ meshlets (mesh);
1415
1406
}
1416
1407
1417
1408
void processNanite (const char * path)
0 commit comments