I'm creating a game board using hexagons, like the attachment. Each hex is made of 24 triangles from 19 vertices. Somewhere in the forums, I found a thread about the GeometryBatch class that said a single large mesh would give better performance than multiple smaller meshes. Therefore I implemented GeometryBatch to stitch together all the individual meshes into one large TriMesh, attach that to a TerrainNode which is attached to the RootNode, and off I go. This mesh then uses a single texture that I'm creating dynamically before attaching it to the TerrainNode. However, I want to create a map that is 29 rows by 43 columns, and I run out of memory trying to create the texture that wants to be more than 2000 pixels per side. I'm thinking that maybe there has to be a better way than the direction I'm going in now.
A map of 29x43 means 1247 meshes, and a total of 29928 triangles from 23693 vertices.
In terms of performance (speed of rendering) and memory usage, for a straight-forward brute-force implementation, what will give the highest speed and least memory required:
- a single mesh of approximately 30K triangles with a single texture approximately 2000 pixels per side attached to a single node
- 1247 nodes attached to the root, each with a single 64x64 texture and a 24 triangle mesh
- some other option that works smarter rather than harder
Thanks!