General Performance Optimization Questions

I have built a fairly small project with low-poly models and very few shaders. Despite this, the game can take quite a bit of time to load and can freeze while in the game. I have followed the optimization guidelines to the best of my ability, but I still think the performance could be better.

I think one of the biggest problems is that I play different mp4 videos throughout the game which is often laggy. I have tried pre-loading the video assets which seems to help a little, but really increases the loading screen time. I am not sure if there is any way to optimize playing videos or if I should just stay away from playing videos in a PlayCanvas project.

I also have a custom cloud shader in my Cloud scene that really lowers performance and just doesn’t work correctly with the new MacOS. I’m not sure if I could have written it differently to help with performance or if it just is not practicle to implement a shader like this with a PlayCanvas project.

I know there isn’t always a “correct” answer when it comes to optimizing for performance, but I would be super greatful for any suggestions or insight.

Here is my project below:

Thanks so much!

Out of curiosity, what browser are you using?

I’ve been using Chrome, but I was hoping it could work on most browsers.

Which scene should be loaded to looking into performance issues (freezes)? And how do we reproduce?

Load time wise, loading the intro scene, the game has 140MB of assets (gzipped), 44.1MB of that is preloaded (gzipped).

If you sort by size in the network tab, you can see which files are the worse offenders:

There are several models that are huge, 14.2MB (1,000K tris) , 11.0MB (750K tris) etc. Do they need to be that large?

We have a page on optimising load time here on strategies to minimise waiting times for the user but it’s only going to help so much with those large file sizes:

If you do need to use models that large, I recommend using the FBX -> GLB conversion rather than FBX -> JSON which is now considered to be deprecated. This will speed up loading times as the browser no longer needs to parse the JSON.

1 Like