Skip to content

Conversation

pavle-goloskokovic
Copy link

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.

@mvaligursky
Copy link
Contributor

any thoughts on this one @slimbuck ?

@querielo
Copy link
Contributor

querielo commented May 19, 2023

Isn't preprocess is suitable for this case?

Documentation

const containerAsset = new pc.Asset(filename, 'container', { url: url, filename: filename }, null, {
    global: {
        preprocess() { console.log("parsing is about to begin"); }
    },
});

@pavle-goloskokovic
Copy link
Author

Isn't preprocess is suitable for this case?

Documentation

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:

createResources(device, gltf, bufferViews, textures, options)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: assets enhancement Request for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants