Advice / direction on why babylon is not using the GPU

Short summary : Have built a complex scene with skyboxes, models, animations, etc and am running into performance issues. When opening the inspector I notice my GPU Frame time is 0.00ms always which I am hoping is what is causing my performance issues. I am looking for any sage advice out there that can point me int the right direction to how they would go about diagnosing and fixing this issue?

More Details :
I would love to create a PG and show this but all the playgrounds that I open (mine and others) all have the GPU Frame time ticking away happily. I am wondering if it something that I am doing on the page, html, babylon, particle system, that is somehow telling the engine / canvas to not sure the GPU. The performance issues above that I mentioned are mainly due to having character meshes and all of them performing animations and seeing “Animations” taking up the majority of my frame time.

What I have done / doing :
I have checked this on multiple browsers, operating systems and computers and they all are reporting 0 GPU frame time. I have built tiny customer scenes not in the PG and verified those also USE the GPU. My next steps are to comment things out of the current scene until I can get to a point where the GPU is re-engaged. This seems very brute for so I am looking for some advice from the exports around here.

Appreciate the help

Hey and welcome!!

Unfortunately GPU frame timing only works on Chrome

Thanks. Thats my problem, on Chrome my GPU Frame timing is reporting as 0. In the playground it reports correctly, in a simple scene it reports correctly, but on my complex scene I get nothing. I even implemented the BABYLON.EngineInstrumentation and printed the gpuFrameTimeCounter from the engine on the screen and screen, and still 0. My concern here is that my scene is taking a huge performance hit by not using the GPU because its 0. Just trying to figure out how to diagnose this and figure out why my scene reports zero while every other playground i use it reports a valid number. Appreciate the additional help.

Ok what about the profiler? Can you profile your code to see where the CPU is spent?

Deltakosh, I really appreciate you lending some brain cells to point me in the right direction. I ran the Chrome profiler during my rendering and have included a screenshot below. What I take away from this is that a lot of the time is spent in the animate code and the processSubCameras (looking into what that is). I am animating about 20 characters from mixamo at the same time doing various animations. Below the flame graph is the GPU profile and it doesn’t look very involved. I would expect more GPU usage when running animations since from the documentation it says for performance bones are stored in shaders and run on the GPU. Again, the inspector comes back at 0 GPU Frame time as well. Any other info you need or suggestions on next steps for myself?


The world matrix of each bone needs to be computed on the cpu. Not sure where this is called, but bones do consume cpu.

You should drill down to try to find calls with a large self time.

Thanks JC. From the call stack I posted above I see large amounts of time spent in t.animate which I assume is the babylon.js animation code and that is taking up a good chunk of my cycle. If that is the case then is your suggestion to reduce CPU usage is to reduce bone count? Any other suggestions or tips on how to engage the GPU more?


Optimize your scene - Babylon.js Documentation can be of a great help.