Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glb container parse event #5295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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 ?

@GSterbrant GSterbrant added the open source contribution Issues related to contributions from people outside the PlayCanvas team label May 12, 2023
@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 feature request open source contribution Issues related to contributions from people outside the PlayCanvas team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants