Vinc3r
February 26, 2021, 9:24am
1
From this doc page Progressively Load .glTF Files | Babylon.js Documentation
we have this playground example https://playground.babylonjs.com/#ARN6TJ#5
Chrome v88: no issue
Firefox v86: Uncaught (in promise) RangeError: offset is outside the bounds of the DataView
issue, and no 3D visible
Edge v88: hmm, even https://playground.babylonjs.com/ throw an error Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
(so not relative to this particular example)
Vinc3r
February 26, 2021, 11:04am
2
Note that with this simple code in local webserver, Firefox load the model:
<body>
<canvas id='canvas'></canvas>
<script type="text/javascript">
var canvas = document.getElementById("canvas");
var engine = new BABYLON.Engine(canvas, true);
var scene = new BABYLON.Scene(engine);
scene.createDefaultCameraOrLight(true, true, true);
BABYLON.SceneLoader.OnPluginActivatedObservable.addOnce(function (loader) {
if (loader.name === "gltf") {
loader.useRangeRequests = true;
}
});
BABYLON.SceneLoader.AppendAsync(
"https://cdn.cp.adobe.io/content/2/content/93f19c5b-5587-4f4f-95bd-99295214aade/version/0",
undefined,
scene,
undefined,
".glb"
);
engine.runRenderLoop(function () {
scene.render();
});
window.addEventListener("resize", function () {
engine.resize();
});
</script>
</body>
But I tried to reproduce this code into the playground, and get the same console error in Firefox! Babylon.js Playground
@Vinc3r I havenโt gotten a chance to look at this yet. Is this an urgent issue for you?
This seems like a Firefox bug. I did a miminal repro in jsfiddle.net and the arraybuffer returned is zero bytes.
https://jsfiddle.net/hLqcxvu6/2/
I filed a bug on Firefox. Letโs see what happens.
1696684 - XMLHttpRequest with partial content returns zero bytes response (mozilla.org)
2 Likes