Glb container parse event
This PR introduces change where parse event is fired on a container asset to indicate that data was downloaded and parsing is about to begin.
This functionality adds more control over loading process, where e.g. we can start loading low priority assets immediately after container asset has downloaded, without needing to wait for its parsing as well, in effect shortening total loading time.
any thoughts on this one @slimbuck ?
Isn't preprocess is suitable for this case?
const containerAsset = new pc.Asset(filename, 'container', { url: url, filename: filename }, null, {
global: {
preprocess() { console.log("parsing is about to begin"); }
},
});
Isn't
preprocessis suitable for this case?const containerAsset = new pc.Asset(filename, 'container', { url: url, filename: filename }, null, { global: { preprocess() { console.log("parsing is about to begin"); } }, });
Unfortunately not since preprocess callback is called within createResources method after parsing is already done:
https://github.com/playcanvas/engine/blob/cee326b46c4025b16a3c301fd285c6319e5793a7/src/framework/parsers/glb-parser.js#L2470