From cb80f32ef1dbd83f1ac80709a507aff35646fadd Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Wed, 25 Dec 2024 12:40:05 +0900 Subject: [PATCH] Add display for batched mesh instances --- example/googleMapsExample.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/example/googleMapsExample.js b/example/googleMapsExample.js index 44562ca91..833f86042 100644 --- a/example/googleMapsExample.js +++ b/example/googleMapsExample.js @@ -349,6 +349,28 @@ function updateHtml() { const programCount = renderer.info.programs.length; str += `Geometries: ${ memory.geometries } Textures: ${ memory.textures } Programs: ${ programCount } Draw Calls: ${ render.calls }`; + const batchPlugin = tiles.getPluginByName( 'BATCHED_TILES_PLUGIN' ); + const fadePlugin = tiles.getPluginByName( 'FADE_TILES_PLUGIN' ); + if ( batchPlugin ) { + + let tot = 0; + let totFade = 0; + batchPlugin.batchedMesh._instanceInfo.forEach( info => { + + if ( info.visible && info.active ) tot ++; + + } ); + + fadePlugin.batchedMesh._instanceInfo.forEach( info => { + + if ( info.visible && info.active ) totFade ++; + + } ); + + str += ', Batched: ' + tot + ', Fade Batched: ' + totFade; + + } + } if ( statsContainer.innerHTML !== str ) {