I'm writing a terrain paging algorithm that will generate terrain in 65x65 chunks.
the issue I'm encountering however is that it's a little too slow for comfort using btTriangleMesh, taking about 0.8 seconds per 65x65 chunk. When paging them in 5 at a time (view distance) it winds up taking about 3-5 seconds, with QuantizedAABB set to false. (about 8-10 seconds if set true)
Running on a quad core 3.2GHz processor.
I've considered using btTriangleIndexVertexArray instead, but figured before I start going down a needlessly complex path I'd be better asking here. Is it any faster at all?
My real concern isn't so much for the terrain, it wouldn't be particularly obvious if I just thread the world code seperate from the rest to avoid the pause, but other static objects will need to be created, modified, and destroyed with much less predictable frequency than the terrain, and may have substantially more than 8k triangles in them, not to mention the quantity of them will be sporadic.
I can't use the heightmap interface as I want to use the same code preferably for loading other objects, such as buildings or other static terrain elements, and as I progress may wish to make the terrain "true" 3d with overhangs and such built right into the mesh. Better to solve it now rather than later.
Alternatively, is there a better interface to use for building static 3d mesh data?
Cheers,
Trioxin
btTriangleMesh slowness?
-
- Posts: 149
- Joined: Fri Jun 24, 2011 8:53 am
Re: btTriangleMesh slowness?
I cannot say much for the terrain chunks but when it comes to generic objects, do not even think about using graphical assets for collision detection. You'll just regret.
See bottom of this page to get an idea on the degree of approximation. Collision meshes must basically be 1998 in complexity.
Although the page is about Unreal Engine, it gives a good hint at the level of approximation allowed in AAA games.
See bottom of this page to get an idea on the degree of approximation. Collision meshes must basically be 1998 in complexity.
Although the page is about Unreal Engine, it gives a good hint at the level of approximation allowed in AAA games.