So, I’ve got two different games, one is just using sprites without 3d models and lighting and the other uses 3d assets and lighting. The sprite-based game is larger in build size, but it loads WAY quicker. Basically the 3d game’s loading bar goes up really quickly, but then it hangs for a long while while the bar is at 100%.
This makes me think it’s something to do with initializing the 3d/lighting rendering that’s making the game hang there. In what ways could I speed up the process from 100% filled loading bar to entering the game? As far as I’m aware I’m not using baked lights etc, but I would appreciate a simplistic “make sure these boxes are toggled off” type of an answer if it’s something related to baking.
Thanks in advance!
A good way to check is to use the profiler in the browser dev tools and break down where the time is spent in each title.
There is some work at 100% such as any code in initialisation, post initialisation, and first update calls. Shaders are being compiled, etc.
Thanks for the extremely swift reply!
This is what the profiler looks like at start… There’s a 10 second gap between the bars and the start time. Can you help with deciphering this?
Ah right, thanks! I’ll look into it!
I’m not sure if I’m reading the profiler correctly (there’s tons of different tasks stacked on top of eachother which all say they last for 13 seconds… but I think it’s because they’re waiting for the rest of it to finish) but I see a ton of these tiny createPhysicalShape tasks here. What do they represent? Is the engine regenerating the meshes or what’s going on?
Found the culprit, there was one mesh that was very unnecessarily high poly and it was using a mesh collider.
Generally, you would want a much simpler variant of the mesh for the collision mesh rather than using the one that is rendered as is for performance (both on initialisation and at runtime).