UPD: See the latest version somewhere below in the thread.
Debugging, to a great extent, is like a detective story.
And in both cases one needs more evidences to catch a a bad egg
This small utility makes some things more evident (actually, some functions are the same as in the Inspector tool) and helped me a lot with finding memory leakages and optimizing scenes. (If your app runs in real time for several hours even 1 texture/minute leak may result to crashes).
FInally I adopted it to PG. There are a lot of possibilities how to develop it further, including some logging capabilities and visual data presentation.
Here is the simplest version - https://playground.babylonjs.com/#938RNX#8
It is possible to use in almost any Playground example, just copy and paste the relevant part!
Here are some examples how to use it to debug with examples from Documentation:
(screenshots are made on old laptop)
While it is extremely funny to press Space to make explosions, one may notice that the number of meshes is increasing with every explosion.
Seems that the problem is that there are conditions when emitter is created but not disposed later.
Just in one day my small utility was better adopted to Firefox, ported to Typescript and one bug removed from Babylon source code. Really fascinating speed, community powered!
I added also the possibility to copy camera position to clipboard (this is very useful for quick tuning and better orientation) and lights counter - here is the latest version: https://playground.babylonjs.com/#938RNX#17
Shows camera position x, y, z or arcRotate camera alpha, beta, radius - click the button to copy to clipboard.
Performance Viewer will be a great tool. Actually most parameters from my utility could be seen at Inspector itself, but it is not always convenient.
I found that GUI suits here the best since it doesn’t block the pointer and you always have real time information about the scene.
There are a lot of parameters which could be used for optimization and reporting. For this utility it means additional tabs and functions, which I would gladly discuss
While it is good for PG, it is possible to develop TS/JS standalone extension which could be easily used in almost any Babylon environment.