Getting Performance Indicators

Hey everyone! I’m keen to collect a bunch of performance indicators that I can print out for testing purposes. In particular, I’m looking for the following info:

  • Target pixel density/ratio (e.g. value of 0.5 = half resolution)
  • Draw calls (average per second)
  • Total rendered vertices
  • Total rendered meshes
  • Total rendered textures

Can anyone tell me if Babylon has a simple way to a get this data? Would really appreciate any help.

Do these help?

1 Like

@JohnK These seem really cool but for the moment I’m just curious if there is a quick class or object that I can use that will allow me to get the data I need. Something like the info class in Three.js (three.js docs)

You can rely on our instrumentation tools: Optimizing Your Scene | Babylon.js Documentation

This is what is actually in use in the perf profiler.

1 Like

Thanks @sebavan! This helped me get some of the information. For others who come across this I ended up using the following to get the data I wanted:

  • Pixel Ratio: engine.getHardwareScalingLevel()
  • Draw calls: sceneInstrumentation.drawCallsCounter.current
  • Total Vertices: scene.totalVerticesPerfCounter.current
  • Total Meshes: scene.meshes.length
  • Total Textures: scene.textures.length
2 Likes