Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cesium no supports loading external "binary buffer" of glb in b3dm? #9124

Open
hanaimin opened this issue Aug 29, 2020 · 1 comment
Open

Comments

@hanaimin
Copy link

In the 3d-tiles b3dm specification. there is a describtion:
Instanced 3D Model embeds glTF 2.0 containing model geometry and texture information.
The glTF asset to be instanced is stored after the Feature Table and Batch Table. It may embed all of its geometry, texture, and animations, or it may refer to external sources for some or all of these data.

But , in cesium, when the b3dm loaded, the external "buffer binary" can not be requested. is it a bug or missing function?
"buffers": [
{
"byteLength": 1113924,
"uri": "0.0.bin"
}
],
tileset.zip

@hanaimin hanaimin changed the title cesium no supports loading external "buffer binary" of glb in b3dm? Aug 29, 2020
@hanaimin
Copy link
Author

function parseGlbVersion2(glb, header) { var length = header[2]; var byteOffset = 12; var gltf; var binaryBuffer; while (byteOffset < length) { var chunkHeader = readHeader(glb, byteOffset, 2); var chunkLength = chunkHeader[0]; var chunkType = chunkHeader[1]; byteOffset += 8; **var chunkBuffer = glb.subarray(byteOffset, byteOffset + chunkLength);** byteOffset += chunkLength; // Load JSON chunk if (chunkType === 0x4E4F534A) { var jsonString = getStringFromTypedArray(chunkBuffer); gltf = JSON.parse(jsonString); addPipelineExtras(gltf); } // Load Binary chunk else if (chunkType === 0x004E4942) { binaryBuffer = chunkBuffer; } } if (defined(gltf) && defined(binaryBuffer)) { var buffers = gltf.buffers; if (defined(buffers) && buffers.length > 0) { var buffer = buffers[0]; **buffer.extras._pipeline.source = binaryBuffer;** } } return gltf; }

it seems as the parseGlb.js parseGlbVersion2 function no supporting to load external .bin file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants