diff --git a/src/neuroglancer/datasource/graphene/backend.ts b/src/neuroglancer/datasource/graphene/backend.ts index 0e6272314e..b05598b3bb 100644 --- a/src/neuroglancer/datasource/graphene/backend.ts +++ b/src/neuroglancer/datasource/graphene/backend.ts @@ -44,7 +44,7 @@ import { SharedWatchableValue } from 'neuroglancer/shared_watchable_value'; import { DisplayDimensionRenderInfo } from 'neuroglancer/navigation_state'; import { forEachVisibleSegment } from 'neuroglancer/segmentation_display_state/base'; import { computeChunkBounds } from 'neuroglancer/sliceview/volume/backend'; -import { verifyObject } from 'src/neuroglancer/util/json'; +import { verifyObject } from 'neuroglancer/util/json'; function getVerifiedFragmentPromise( credentialsProvider: SpecialProtocolCredentialsProvider, @@ -142,12 +142,12 @@ function decodeMultiscaleManifestChunk(chunk: GrapheneMultiscaleManifestChunk, r verifyObject(response); chunk.manifest = { chunkShape: vec3.clone(response.chunkShape), - chunkGridSpatialOrigin: vec3.create(), + chunkGridSpatialOrigin: vec3.clone(response.chunkGridSpatialOrigin), lodScales: new Float32Array(response.lodScales), octree: new Uint32Array(response.octree), vertexOffsets: new Float32Array(response.lodScales.length * 3), - clipLowerBound: vec3.create(), - clipUpperBound: vec3.create(), + clipLowerBound: vec3.clone(response.clipLowerBound), + clipUpperBound: vec3.clone(response.clipUpperBound), } chunk.fragmentIds = response.fragments; } @@ -157,7 +157,7 @@ async function decodeMultiscaleFragmentChunk( const {lod} = chunk; const source = chunk.manifestChunk!.source! as GrapheneMultiscaleMeshSource; const m = await import(/* webpackChunkName: "draco" */ 'neuroglancer/mesh/draco'); - const rawMesh = await m.decodeDracoPartitioned(new Uint8Array(response), 0, lod !== 0); + const rawMesh = await m.decodeDracoPartitioned(new Uint8Array(response), 0, lod !== 0, false); assignMultiscaleMeshFragmentData(chunk, rawMesh, source.format.vertexPositionFormat); } diff --git a/src/neuroglancer/datasource/precomputed/backend.ts b/src/neuroglancer/datasource/precomputed/backend.ts index ce0162cd20..c0ab0b719b 100644 --- a/src/neuroglancer/datasource/precomputed/backend.ts +++ b/src/neuroglancer/datasource/precomputed/backend.ts @@ -538,7 +538,7 @@ async function decodeMultiscaleFragmentChunk( const source = chunk.manifestChunk!.source! as PrecomputedMultiscaleMeshSource; const m = await import(/* webpackChunkName: "draco" */ 'neuroglancer/mesh/draco'); const rawMesh = await m.decodeDracoPartitioned( - new Uint8Array(response), source.parameters.metadata.vertexQuantizationBits, lod !== 0); + new Uint8Array(response), source.parameters.metadata.vertexQuantizationBits, lod !== 0, true); assignMultiscaleMeshFragmentData(chunk, rawMesh, source.format.vertexPositionFormat); } diff --git a/src/neuroglancer/mesh/draco/index.ts b/src/neuroglancer/mesh/draco/index.ts index ab47e52891..ad8ac0604f 100644 --- a/src/neuroglancer/mesh/draco/index.ts +++ b/src/neuroglancer/mesh/draco/index.ts @@ -61,14 +61,14 @@ const dracoModulePromise = (async () => { export async function decodeDracoPartitioned( buffer: Uint8Array, vertexQuantizationBits: number, - partition: boolean): Promise { + partition: boolean, skipDequantization: boolean): Promise { const m = await dracoModulePromise; const offset = (m.instance.exports.malloc as Function)(buffer.byteLength); const heap = new Uint8Array((m.instance.exports.memory as WebAssembly.Memory).buffer); heap.set(buffer, offset); numPartitions = partition ? 8 : 1; const code = (m.instance.exports.neuroglancer_draco_decode as Function)( - offset, buffer.byteLength, partition, vertexQuantizationBits, false); + offset, buffer.byteLength, partition, vertexQuantizationBits, skipDequantization); if (code === 0) { const r = decodeResult; decodeResult = undefined;