提交 d0b32bfe 编写于 作者: D Don McCurdy

Use 'blob:...' URL to speed up parsing of texture buffers.

上级 24f2f9e2
......@@ -640,6 +640,13 @@ THREE.GLTF2Loader = ( function () {
}
// Blob URL
if ( /^blob:.*$/i.test( url ) ) {
return url;
}
// Relative URL
return ( path || '' ) + url;
......@@ -1070,8 +1077,9 @@ THREE.GLTF2Loader = ( function () {
if ( source.bufferView !== undefined ) {
var bufferView = dependencies.bufferViews[ source.bufferView ];
var stringData = convertUint8ArrayToString( new Uint8Array( bufferView ) );
sourceUri = 'data:' + source.mimeType + ';base64,' + btoa( stringData );
var blob = new Blob( [ bufferView ], { type: source.mimeType } );
var urlCreator = window.URL || window.webkitURL;
sourceUri = urlCreator.createObjectURL( blob );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册