I’m experimenting with Hex grid layouts and testing essentially the most environment friendly approach of constructing a hex map.
I attempted 2 issues:
- Construct my very own hex mesh utilizing 6 triangles and seven vertices
- Use blender to create a Hex and import it
For 1. The mesh renderer I created is connected to an object prefab and I instantiate one for every Hex in my grid. 2 is sort of related however I imported the .fbx mannequin from blender and I created a prefab from it. Then instantiate one per hex in my grid.
Query: Why is the Blender strategy giving me higher efficiency then once I create the meshes myself?
After I use the primary strategy with the meshes I created, I am getting round 44FPS
However once I use the Blender strategy I get round 60 FPS
Data on how I am creating my meshes.
I create 7 vertices, Marked on this screenshot from 0 to six
Then my triangles shall be:
Listing<int> triangles = new Listing<int>() {
0, 2, 1,
0, 3, 2,
0, 4, 3,
0, 5, 4,
0, 6, 5,
0, 1, 6,
};
//Create the Mesh
m_mesh = new Mesh();
m_mesh.title = "Hex";
m_mesh.vertices = vertices.ToArray();
m_mesh.triangles = triangles.ToArray();
m_mesh.uv = uvs.ToArray();
m_mesh.RecalculateNormals();