How to enables cesium inspector mixin performance display by default?

Hi all!

I am playing with the cesium sandbox and would like to have the performance display (FPS & time in ms per frame) from cesium inspector mixin enabled by default. By now I found a solution that seems to be kind of bulky to me:

CesiumViewer.js

viewer.extend(viewerCesiumInspectorMixin);

viewer.cesiumInspector.viewModel.performance = true;
viewer.cesiumInspector.viewModel._showPerformance();
viewer.cesiumInspector.viewModel.update();
knockout.getObservable(viewer.cesiumInspector.viewModel, 'performance')(true);

``

for the above code to work I also had to force knockout to track the performance variable inside cesium.

CesiumInspectorViewModel,js

knockout.track(this, [‘filterTile’, ‘suspendUpdates’, ‘dropDownVisible’, ‘shaderCacheText’, ‘frustums’,

‘frustumStatisticText’, ‘pickTileActive’, ‘pickPrimitiveActive’, ‘hasPickedPrimitive’,

‘hasPickedTile’, ‘tileText’, ‘performance’, ‘generalVisible’, ‘generalSwitchText’,

‘primitivesVisible’, ‘primitivesSwitchText’, ‘terrainVisible’, ‘terrainSwitchText’, ‘depthFrustumText’]);

``

Is there a proper way of enabling performance display in cesium inspector mixin?

With best regards,

Alexey

Hello,

If you just care about seeing the FPS and ms/frame, you can add this line to your code:

scene.debugShowFramesPerSecond = true;

``

When I wrote the inspector widget years ago, I was really new to using knockout and it looks like I made some bad decisions. Currently, I think the method you’re using is the best way to override values.

I wrote an issue to clean up the code here: https://github.com/AnalyticalGraphicsInc/cesium/issues/3747

Thanks!

Hannah

Hey, this problem has been fixed, and the updates to the inspector will be included in the next release. Showing performance now works with just the following:

viewer.extend(viewerCesiumInspectorMixin);
viewer.cesiumInspector.viewModel.performance = true;

Thank you for reporting this!
Austin