[SOLVED] playcanvas.js custom loading will delay for a few seconds until the final page is truly rendered

I wrote a custom loading progress bar that goes to 100% and causes the loading to disappear. The page will first appear black before rendering. If I listen to app. on ('start ') and then cause the loading to disappear, the progress bar will pause for 3-4 seconds at the end before displaying the page normally

Hi @Guohao6666,

What’s your question exactly? If you are asking about the last 3-4 seconds that the loading screen seems paused then that most likely is when the JavaScript main thread is blocked by an operation.

It may be from shaders compiling or mesh colliders getting generated. Basically anything that takes longer than a single frame takes to render. There aren’t much you can do about this.

Through investigation, it was found that the last few seconds of running the project were related to the model in my project. I used Draco to compress the grid for the model. Is this related to the model? How can I solve the problem of the last few seconds of loading and stopping

Hmm not sure given there is not loading progress coming out from those thread blocking operations.

You could artificially change the loading progress calculator in the splash screen script, give it more room at the end. E.g. when PlayCanvas reports 100/100 are ready, reduce the value to 80/100.

Try to update Chrome to the latest 116 version. The earlier version had a shader compilation bug, causing it to be slower than usual.

1 Like

Thank you. I’m ready to give it a try

As far as I know of the loading progress of the loading page is counting on asset download. It doesn’t calcualte rendering time.

1 Like

Yes that’s correct, the main issue I think here is that as soon as the bar fills to 100% (all assets finished downloading). It stills waits there for a few seconds, doing other things and stack at 100%.

Thank you. I have updated to the latest version and found that the loading and rendering of the latest version are very smooth

1 Like