Monday, 27 September 2010

Triangle-precision ray collision

Bullet collision was previously calculated using the triangle mesh capabilities of BEPU. This wasn't going to work efficiently with all the separate meshes that are going to be used in our levels. With the basics of triangle-picking already implemented in the editor tools it didn't take a lot of time to get a basic prototype up and running. In the image below you can see the new filtering algorithm.

each "group" (1 big sphere, 8 small ones) contain 41k polygons. (click image to read the text)

In a regular scene with a higher amount of objects with lower polygons per mesh that are spread across the scene, the optimization methods will become more efficient. This will be tested once the prototype level is complete.
The main focus of the new filtering system is excluding hidden models before they enter into the per-triangle collision check. This system is added on top of the bounding-sphere filter that was already present in the editor tool.


Overkill? 150 million triangles both rendered and tested against the bullet ray. This clearly wasn't going to run smoothly (roughly 0.1 fps)

Video:
(use 720p and fullscreen to read the filtering info in the topleft corner)

1 comment:

  1. Looking good!

    Just wanted to let you know that there's some significant improvements coming in BEPU's raycasting system. Instanced triangle meshes and better broadphase integration should make that scenario quite speedy :)

    ReplyDelete