I’m hoping to get a few ideas on how I might be able to solve my challenge. I’ve been tinkering around with trying to render a hex-grid tiling texture, on top of a mesh, to be able to ‘fake’ a rendered grid, but while saving resources.
The goal would be to be able to render very large grids (100.000+ tiles) without having too many vertices, so having a tiling texture came to mind. The issue I’m having is that the texture tiling seems to have a ‘wave’ effect, where it correctly tiles in some areas, but then it offsets in others.
I’ve put together a small playground which does the following:
- generates a logical hex grid using an external library
- using a LineSystem, renders the lines for each hex. As you can imagine, a lot of vertices/faces can come up here.
- creating a simple Cylinder mesh (with tesselation=6 to make it a hexagon)
- load & apply a hex grid texture on top
- try to guess the correct uScale/vScale for the texture so that it correctly matches the scale of the rendered grid through lines
- the logical grid will be used as a template for pointer actions (find which tile you’ve clicked)
- the grid lines are missing some lines at the edges, not an issue for this scenario (the line system is only used to showcase the desired result)
I’ve tried other types of hex textures with different tiles, but I always seem to get the ‘wave’ tiling effect. Any ideas what might cause this effect, and how to get around it?