How to make Frustum culling :D

Hi I am back again weeeew :smiley:

So I am making Rpg game on electronjs and I have mid-size scene with lot of obj. A I want to implement Frustum culling but I didn’t find anithig how to make it work, only what I found was camera.isInFrustum() so i tryed something like this on one door obj.:
it starts on 250line :

Quistions: Is the better way to do it? and how to make work setEnabled funcion in for loop with all exported obj. ?

Thanks :wink:

mesh.isInFrustum(scene.frustumPlanes) is already used by BJS to cull every mesh of the scene in the standard rendering process

1 Like

@jerome So babylonjs have defaultly frustum culling. Only what I can do is change the strategy of culling.
am I right ?
sorry for stupid question but my english is not the best.

The meshes to be rendered are selected by a culling process of which you can change the behavior.

Selecting a BoudingSphere based test will increase the perfs and reduce the accuracy (leading potentially to false positives = selection of meshes that won’t be visible anyway).

You can even use mesh.isInFrustum() for your own needs more over (say, to disable unselected meshes ? or any other goal)

1 Like

Thank you very much @jerome for explanation :slight_smile:

1 Like