mirror of
https://github.com/openharmony/third_party_meshoptimizer.git
synced 2026-07-21 08:05:22 -04:00
js: Expose meshopt_spatialSortRemap as meshopt_encoder @ reorderPoints
Similarly to reorderMesh, reorderPoints can improve spatial locality of point clouds, which results in improved compression ratio when using attribute encoder, and may also improve rendering performance by improving rasterization locality.
This commit is contained in:
@@ -47,8 +47,8 @@ WASM_EXPORT_PREFIX=-Wl,--export
|
||||
WASM_DECODER_SOURCES=src/vertexcodec.cpp src/indexcodec.cpp src/vertexfilter.cpp tools/wasmstubs.cpp
|
||||
WASM_DECODER_EXPORTS=meshopt_decodeVertexBuffer meshopt_decodeIndexBuffer meshopt_decodeIndexSequence meshopt_decodeFilterOct meshopt_decodeFilterQuat meshopt_decodeFilterExp sbrk __wasm_call_ctors
|
||||
|
||||
WASM_ENCODER_SOURCES=src/vertexcodec.cpp src/indexcodec.cpp src/vertexfilter.cpp src/vcacheoptimizer.cpp src/vfetchoptimizer.cpp tools/wasmstubs.cpp
|
||||
WASM_ENCODER_EXPORTS=meshopt_encodeVertexBuffer meshopt_encodeVertexBufferBound meshopt_encodeIndexBuffer meshopt_encodeIndexBufferBound meshopt_encodeIndexSequence meshopt_encodeIndexSequenceBound meshopt_encodeVertexVersion meshopt_encodeIndexVersion meshopt_encodeFilterOct meshopt_encodeFilterQuat meshopt_encodeFilterExp meshopt_optimizeVertexCache meshopt_optimizeVertexCacheStrip meshopt_optimizeVertexFetchRemap sbrk __wasm_call_ctors
|
||||
WASM_ENCODER_SOURCES=src/vertexcodec.cpp src/indexcodec.cpp src/vertexfilter.cpp src/vcacheoptimizer.cpp src/vfetchoptimizer.cpp src/spatialorder.cpp tools/wasmstubs.cpp
|
||||
WASM_ENCODER_EXPORTS=meshopt_encodeVertexBuffer meshopt_encodeVertexBufferBound meshopt_encodeIndexBuffer meshopt_encodeIndexBufferBound meshopt_encodeIndexSequence meshopt_encodeIndexSequenceBound meshopt_encodeVertexVersion meshopt_encodeIndexVersion meshopt_encodeFilterOct meshopt_encodeFilterQuat meshopt_encodeFilterExp meshopt_optimizeVertexCache meshopt_optimizeVertexCacheStrip meshopt_optimizeVertexFetchRemap meshopt_spatialSortRemap sbrk __wasm_call_ctors
|
||||
|
||||
WASM_SIMPLIFIER_SOURCES=src/simplifier.cpp src/vfetchoptimizer.cpp tools/wasmstubs.cpp
|
||||
WASM_SIMPLIFIER_EXPORTS=meshopt_simplify meshopt_simplifyWithAttributes meshopt_simplifyScale meshopt_optimizeVertexFetchRemap sbrk __wasm_call_ctors
|
||||
|
||||
+25
-4
File diff suppressed because one or more lines are too long
Vendored
+1
@@ -5,6 +5,7 @@ export const MeshoptEncoder: {
|
||||
ready: Promise<void>;
|
||||
|
||||
reorderMesh: (indices: Uint32Array, triangles: boolean, optsize: boolean) => [Uint32Array, number];
|
||||
reorderPoints: (positions: Float32Array, positions_stride: number) => Uint32Array;
|
||||
|
||||
encodeVertexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
|
||||
encodeIndexBuffer: (source: Uint8Array, count: number, size: number) => Uint8Array;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -37,6 +37,22 @@ var tests = {
|
||||
assert.equal(res[1], 6); // unique
|
||||
},
|
||||
|
||||
reorderPoints: function() {
|
||||
var points = new Float32Array([
|
||||
1, 1, 1,
|
||||
11, 11, 11,
|
||||
2, 2, 2,
|
||||
12, 12, 12,
|
||||
]);
|
||||
|
||||
var expected = new Uint32Array([
|
||||
0, 2, 1, 3
|
||||
]);
|
||||
|
||||
var remap = encoder.reorderPoints(points, 3);
|
||||
assert.deepEqual(remap, expected);
|
||||
},
|
||||
|
||||
roundtripVertexBuffer: function() {
|
||||
var data = new Uint8Array(16 * 4);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user