Skip to content

Commit

Permalink
vertexcodec: Add a note about quantization and locality of reference
Browse files Browse the repository at this point in the history
For optimum compression, the vertex buffer should carry quantized values
and have consecutive vertices be reasonably local which can be achieved
with regular vertex cache/fetch optimization for most meshes.

An alternative to quantization is filtering but since it is unlikely to
be as broadly used it's probably enough to just call out quantization
here.
  • Loading branch information
zeux committed Sep 27, 2024
1 parent be4d566 commit b1e5449
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/meshoptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ MESHOPTIMIZER_API int meshopt_decodeIndexSequence(void* destination, size_t inde
* Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space
* This function works for a single vertex stream; for multiple vertex streams, call meshopt_encodeVertexBuffer for each stream.
* Note that all vertex_size bytes of each vertex are encoded verbatim, including padding which should be zero-initialized.
* For maximum efficiency the vertex buffer being encoded has to be quantized and optimized for locality of reference (cache/fetch) first.
*
* buffer must contain enough space for the encoded vertex buffer (use meshopt_encodeVertexBufferBound to compute worst case size)
*/
Expand Down

0 comments on commit b1e5449

Please sign in to comment.