[ad_1]
I’m experimenting with Hex grid layouts and testing essentially the most environment friendly manner of constructing a hex map.
I attempted 2 issues:
- Build 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 hooked up 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.
Question: Why is the Blender strategy giving me higher efficiency then once I create the meshes myself?
When I exploit the primary strategy with the meshes I created, I’m getting round 44FPS
But once I use the Blender strategy I get round 60 FPS
Info on how I’m creating my meshes.
I create 7 vertices, Marked on this screenshot from 0 to six

Then my triangles might be:
List<int> triangles = new List<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();
[ad_2]

