- Home /
Texture grid displayed oddly when width =/= height
The attached package (from another answer) contains a demo scene which creates a mesh for use as a tile grid based on the mesh's UV coordinates and a hashtable of texture coordinates. It works fine when the grid's width and height are equal, but not when they are unequal. For example, if the height is higher than the width (5x6, 5x7, etc.), each column will be offset by the difference (6-5=1, 7-5=2, etc.). I've read through the undocumented code and can wrap my head around the vast majority of it after some time, but I'm not seeing anything that can cause such strange behavior.
My ultimate goal is to present a single mesh containing a grid of textures which can be modified at runtime to change the appearance of roguelike game tiles (because a grid of game objects, each with their own mesh renderer, quickly becomes expensive). So, if it's to that end, I'm open to alternatives.
Answer by youngapprentice · Aug 14, 2012 at 05:53 AM
Could you possibly change the texture import settings to "Advanced" and under "Non Power of 2", select "None" for rounding? It should clamp pretty perfectly...
Er, was this reply to a different answer? The texture is already a power of 2. As such, the option is greyed out.