noname0310/babylon-mmd

Texture load/shader compilation delay

Closed this issue · 17 comments

2023-08-08.16.12.45.mov

When loading the model, he renders it white without textures.

Maybe you can use something like Promise.all to solve this problem?

use Append / AppendAsync (loading screen automatically appears):

SceneLoader.AppendAsync(
    "https://a-cdn.qbox.net/test/models/pmx/[MODELS]%20Lovesick%20girls%20ver.1/[LSG]%20Jennie%20(Miku)%20ver.1.pmx",
    undefined,
    scene
);

use ImportMesh / ImportMeshAsync (show loading screen manually):

engine.displayLoadingUI();

SceneLoader.ImportMeshAsync(
    undefined,
    "https://a-cdn.qbox.net/test/models/pmx/[MODELS]%20Lovesick%20girls%20ver.1/[LSG]%20Jennie%20(Miku)%20ver.1.pmx",
    undefined,
    scene
).then(result => result.meshes[0])
    .then(mmdMesh => {
        engine.hideLoadingUI();
        mmdMesh.receiveShadows = true;
    });

or use LoadAssetContainer / LoadAssetContainerAsync (There is a lag while loading without a loading screen)

SceneLoader.LoadAssetContainerAsync(
    "https://a-cdn.qbox.net/test/models/pmx/[MODELS]%20Lovesick%20girls%20ver.1/[LSG]%20Jennie%20(Miku)%20ver.1.pmx",
    undefined,
    scene
).then(result => {
    result.addAllToScene();
});

Can't importMeshAsync solve this problem?

It's in the answer I gave you

Other loader using import mesh async does not have this problem, should it also be solved?

Now things will go as you want. However, as it doesn't seem to be a particularly important factor, I won't update the version right now. Please let me know if this is a problem that needs to be solved urgently

If you think this can be fixed with pr, then I can try to bring up a pr.

There seems to be a misunderstanding It's already solved and I just haven't updated the npm package version yet

Are you referring to the problem of this issue? If yes, please inform me if there is any package to update npm, thank you

I mean I don't seem to need to do npm publish right now because the severity of this problem seems low

Yes, but I hope you'll let me know if this issue is fixed after the next npm package is released, which I think is an optimization

Okay, I'll let you know when 0.24.0 released

I plan to do a new release when this issue is resolved.

Nice bro! And i suggest that you use Link Commits to GitHub Issues, which will make it clearer which issues are resolved by which commits, and it will also help your project to be more robust and maintainable.

I think commit already linked this issue

88a0596

Nice,i saw it.

babylon-mmd 0.24.0 is released now. see CHANGELOG.md

Nice job! It is solved.