Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/ResourceLoader/loader_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class ResourceLoaderUtils {
* @returns {boolean} `true` if the URL is absolute, `false` otherwise.
*/
static isAbsoluteUrl(url) {
if (url.startsWith("data:")) {
return false;
}
const colonIndex = url.indexOf(":");
const slashIndex = url.indexOf("/");
return colonIndex !== -1 && (slashIndex === -1 || colonIndex < slashIndex);
Expand Down
8 changes: 7 additions & 1 deletion source/gltf/primitive.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,15 @@ class gltfPrimitive extends GltfObject {

copyDataFromDecodedGeometry(gltf, dracoGeometry, primitiveAttributes) {
// indices
let indexBuffer = dracoGeometry.index.array;
if (this.indices !== undefined) {
let indexBuffer = this.loadArrayIntoArrayBuffer(
dracoGeometry.index.array,
dracoGeometry.index.array.constructor.name
);
this.loadBufferIntoGltf(indexBuffer, gltf, this.indices, 34963, "index buffer view");

// DRACO decoder always outputs uint32 indices
gltf.accessors[this.indices].componentType = GL.UNSIGNED_INT;
}

// Position
Expand Down