# Hexagonal map mesh texturing

Hello,
I started working on game with hexagonal map, simple turn-based strategy. I try to make a map single mesh, and I already created code that draws hexagons, my problem however is that since I want fields to have height, I need to add sides. With some tinkering , because all vertices are in single buffer I just need to add additional triangles to index buffer. That’s still ok. Problem are texture coordinates. I drew quick example:

If I’d like to have 3 different textures for both green, blue and top sides, can I do it without creating 3 separate vertices in that red point? Also, since I’m trying to create whole map as single mesh, does it mean I have to somehow “bake” all used textures into one large and use coordinates? This is my first time working on 3d graphics in game, so I find lots of things confusing.

No. At least you don’t want to.

Those are three different vertexes in OpenGL terms. A vertex being all of the unique attributes of the vertex.

Speaking from some experience, I would recommend by starting with single hexagon tile, 1 unit high, 6 sides, a top and a bottom, get that working and textured well, then move on to combining multiple to make your map.

Starting simple and getting a solid base will make things a whole lot easier down the track.

1 Like

And each side will have four of its own unique vertexes (two triangles). And the tops will have 6 unique vertexes (and however many triangles you use to split it up (4 or 6 or whatever).

Actually I just finished part computing vertices normals and it looks quite neat imo. (link)
Though, glow lowered fps by ~400 and is rather meh, I’ll have to work on that later. This is however simpliest map design I created to move developement to more exciting things.
I wonder if there is really need to forcibly reduce vertice count where things could be done faster and simplier?

1 Like

Looks nice!
Lots of objects though, you should probably try to minimize this first instead of the number of vertices.

Yeah, vertexes don’t matter much but object count is a killer.