LODESTAR

Showing posts tagged frustum

Switched the chunk frustum culling from bounding boxes to bounding spheres and wrote spherical vertex buffer magic to visualize it.

Using bounding boxes, each chunk completely outside the frustum would generate 8 tests; one test for each point given that if said point is on the wrong side of one frustum plane, it is outside the frustum. With roughly 2,242 chunks outside the frustum, 17,936 tests would be performed 25 times per second - or 448,400 tests per second.

Using bounding spheres, each chunk completely outside the frustum now generates one test; if the signed distance from the center of the sphere is less than the negated radius of the sphere, it is outside the frustum. Again, with roughly 2,242 chunks outside the frustum, only 56,050 tests are performed each second.

That’s a difference of 392,350 tests per second! (A reduction of 87.5%)

Update on the new Lodestar engine:

  • Octree based frustum culling
  • Dynamic loading / unloading of tile chunks
  • Bounding box and chunk data pools to re-use objects