r/PlayCanvas • u/mvaligursky • 3h ago
PlayCanvas Inspector 0.6.0: snapshot your app’s video memory and explore it as a treemap
We just released PlayCanvas Inspector 0.6.0, a debug panel you drop into a running PlayCanvas app. The big new feature is snapshots.
On the Memory, Assets, Render targets, Meshes and Shaders tabs you can now:
Capture what the tab measures at one moment. The snapshot holds still while your app keeps running.
Open it as a treemap in a tab of its own: every texture, buffer, mesh or shader is a box sized by its bytes, grouped by kind, model file or render target.
Zoom in with Ctrl + wheel and drag around, so the small boxes get room for their names.
Compare two snapshots to see what was added and removed, or size the boxes by how much they changed, so a small leak stands out next to big textures.
Click a box to jump to that object in the tab that lists it.
The video uses the engine's Welcome example. Almost all of its ~50 MB of video memory turns out to be render targets: the planar reflection (21 MB), the shadow map (16 MB) and the scene color buffers.
Snapshots only hold weak references, so they never keep anything of your app alive, which matters when you're hunting a leak.
Getting started:
npm install @playcanvas/inspector
import { Inspector } from '@playcanvas/inspector';
const inspector = new Inspector(app);Docs: https://developer.playcanvas.com/user-manual/debugging/inspector/#snapshots
Also new in 0.6.0: a Layers tab showing the layer composition in render order, with a way to hide a layer from the view.
What would you like to be able to measure next? Feedback welcome.