Question about Thin Instance Frustum Culling

Hi there :slight_smile:

I’m working on a project that makes use of a massive amount of instanced cubes (few million) and have recently transition from using THREE.js to Babylon (mostly because of WebGPU support and occlusion culling).

In THREE.js, instanced meshes recently gained the ability to be frustum culled. I’m wondering if thin instances in BabylonJS work the same. From what I understand, Babylon applies frustum culling by default (no additional camera configuration required). Basically, I am asking: Are thin instances affected by Babylon’s default frustum culling? Does the culling affect the entire instance at once, or are some instances hidden and others are shown (depending on what is in the frustum)?

From my perspective, I am new to Babylon but have been using Three for several years. I am very impressed by the feature set of this engine. Thanks for your time, please let me know if I have gotten anything wrong.

1 Like

Hey! Welcome aboard!

These posts might help you to understand how it works:

1 Like

By default, thin instances are frustum culled. If you update a thin instance with thinInstanceSetMatrixAt or thinInstanceSetBuffer, the bounding info will be refreshed.

You can disable automatic refresh of the bounding box by setting doNotSyncBoundingInfo = true on the mesh. Call thinInstanceRefreshBoundingInfo() yourself when you need to update the bounding info.

Bounding info encompasses all thin instances, we do not cull at the single thin instance level (this would defeat the purpose of using thin instances).

1 Like