Im having problems with image atlas , im trying this for reduce draw calls. i have a 15x10 squares with image each, all have the same two materials , a lot of draw calls. I put all the images in the same big image, i have a function that getme the offset and escale with and id of the image, 1. If i try to do this: Code (csharp): ObjetosTiles[x+y*VisibleAncho].renderer.sharedMaterial = TexturaTotalMaterial; Vector2[] VectoresTexturas=SetSpriteAnimation(9 ,11 ,TileReal.Tipo ); ObjetosTiles[x+y*VisibleAncho].renderer.sharedMaterial.SetTextureOffset ( "_MainTex", VectoresTexturas[0] ); ObjetosTiles[x+y*VisibleAncho].renderer.sharedMaterial.mainTextureScale = VectoresTexturas[1]; All the images looks equl , because im switchin the offset of all. but if y try to do this: Code (csharp): ObjetosTiles[x+y*VisibleAncho].renderer.material= TexturaTotalMaterial; Vector2[] VectoresTexturas=SetSpriteAnimation(9 ,11 ,TileReal.Tipo ); ObjetosTiles[x+y*VisibleAncho].renderer.material.SetTextureOffset ( "_MainTex", VectoresTexturas[0] ); ObjetosTiles[x+y*VisibleAncho].renderer.material.mainTextureScale = VectoresTexturas[1]; or anything like this, i have the same draw calls caused for all the materials are material instances. How to solve this? 2.The second problem is that not match perfectly the tiles, maybe caused for the float precission? how to solve this? 3.I need to materials, one for ground and one for decoration, is possible? Thanks
1. Use mesh UV coordinates instead of SetTextureOffset. 2. If your textures are right next to each other in atlas, any filtering mode other than point will cause bleeding http://forum.unity3d.com/attachment.php?attachmentid=50563&d=1366188917 Other option is to add space between the images in the atlas