Mesh Culling Strategy

Now a culling strategy can be set per mesh :

  • Standard : the more accurate and standard one (exclusion test)
  • Bounding Sphere Only : faster but less accurate (exclusion test)
  • Optimistic Inclusion : mesh center inclusion test then standard exclusion test, for meshes almost always expected in the frustum. Same accuracy than the standard test.
  • Optimistic Inclusion Then Bounding Sphere Only : mesh center inclusion test, then bounding sphere exclusion test only. Same accuracy than the bSphereOnly test, interesting for almost always in the frustum meshes.

Tests done on my computer with 83 meshes, 81 moving and 2 static (a ground and a column) :

  • switching to bSphereOnly processes (with or with optimistic inclusion mode) always gives a good gain vs standard process, whatever none, some or all meshes are in the frustum. It’s expected because there aren’t any longer the BBox evaluations (so 48 iterations less).
  • switching to Optimistic Inclusion processes (with or without bSphereOnly mode) gives a very little gain when all the meshes are visible and no sensible loss when no mesh is visible.

In brief, Optimistic Inclusions work but give very little gain. They keep the same accuracy than the basic mode on what they are applied (standard or bSphereOnly).
bSphereOnly, because it reduces a lot the accuracy, gives a good perf gain. This should not be used with high poly meshes while sending false positives to the GPU has a real rendering cost. This can be very interesting for numerous low poly meshes instead.


huu… please wait for the PR to be merged, if it’s accepted.

ooops, I forgot to tell how to use it :

* Possible values : 
         * - AbstractMesh.CULLINGSTRATEGY_STANDARD  

mesh.cullingStrategy = oneOfThePossibleValues;