I'm researching new ways to optimize games for better performance. Currently I am working on texture atlasing, which is giving me a hard time. I made the atlas using Texture2D.PackTextures
and saved the offset and height and width values to a text file.
Now when I insert the values to a material the texture is shown correctly, but since batching requires that the same material is used - how I can I use the same material with different offsets?
Picture: All the cubes use the same texture. Only the two on the right batch as they use the same material.