Skip to content

Commit b97aa46

Browse files
committed
clusterizer: Update documented limits
We now support max_vertices=256
1 parent 58572d1 commit b97aa46

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/meshopt_clusterizer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ var MeshoptClusterizer = (function () {
225225
assert(vertex_positions instanceof Float32Array);
226226
assert(vertex_positions.length % vertex_positions_stride == 0);
227227
assert(vertex_positions_stride >= 3);
228-
assert(max_vertices <= 255 || max_vertices > 0);
228+
assert(max_vertices <= 256 || max_vertices > 0);
229229
assert(max_triangles <= 512);
230230
assert(max_triangles % 4 == 0);
231231

src/meshoptimizer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ struct meshopt_Meshlet
544544
* meshlet_vertices must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_vertices
545545
* meshlet_triangles must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_triangles * 3
546546
* vertex_positions should have float3 position in the first 12 bytes of each vertex
547-
* max_vertices and max_triangles must not exceed implementation limits (max_vertices <= 255 - not 256!, max_triangles <= 512; max_triangles must be divisible by 4)
547+
* max_vertices and max_triangles must not exceed implementation limits (max_vertices <= 256, max_triangles <= 512; max_triangles must be divisible by 4)
548548
* cone_weight should be set to 0 when cone culling is not used, and a value between 0 and 1 otherwise to balance between cluster size and cone culling efficiency
549549
*/
550550
MESHOPTIMIZER_API size_t meshopt_buildMeshlets(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight);
@@ -561,7 +561,7 @@ MESHOPTIMIZER_API size_t meshopt_buildMeshletsBound(size_t index_count, size_t m
561561
* meshlet_vertices must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_vertices
562562
* meshlet_triangles must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_triangles * 3
563563
* vertex_positions should have float3 position in the first 12 bytes of each vertex
564-
* max_vertices, min_triangles and max_triangles must not exceed implementation limits (max_vertices <= 255 - not 256!, max_triangles <= 512; min_triangles <= max_triangles; both min_triangles and max_triangles must be divisible by 4)
564+
* max_vertices, min_triangles and max_triangles must not exceed implementation limits (max_vertices <= 256, max_triangles <= 512; min_triangles <= max_triangles; both min_triangles and max_triangles must be divisible by 4)
565565
* cone_weight should be set to 0 when cone culling is not used, and a value between 0 and 1 otherwise to balance between cluster size and cone culling efficiency; additionally, cone_weight can be set to a negative value to prioritize axis aligned clusters (for raytracing) instead
566566
* split_factor should be set to a non-negative value; when greater than 0, clusters that have large bounds may be split unless they are under the min_triangles threshold
567567
*/
@@ -573,7 +573,7 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_buildMeshletsFlex(struct meshopt_Meshl
573573
*
574574
* meshlet_triangles and meshlet_vertices must refer to meshlet triangle and vertex index data; when buildMeshlets* is used, these
575575
* need to be computed from meshlet's vertex_offset and triangle_offset
576-
* triangle_count and vertex_count must not exceed implementation limits (vertex_count <= 255 - not 256!, triangle_count <= 512)
576+
* triangle_count and vertex_count must not exceed implementation limits (vertex_count <= 256, triangle_count <= 512)
577577
*/
578578
MESHOPTIMIZER_API void meshopt_optimizeMeshlet(unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, size_t triangle_count, size_t vertex_count);
579579

0 commit comments

Comments
 (0)