1
\$\begingroup\$

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?

enter image description here

Picture: All the cubes use the same texture. Only the two on the right batch as they use the same material.

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I think you have 3 options:

  1. Change UVs to point directly to the object on the texture atlas (in effect having N:N meshes:textures)
  2. Create a seperate material per texture
  3. If you change tiling via script it should work on the same material (although it might just be creating a clone of the current material)

P.S. I haven't read the whole post but it seems to be discussing your question: http://answers.unity3d.com/questions/276212/what-is-the-simple-way-of-applying-texture-atlas-t.html

\$\endgroup\$
1
  • \$\begingroup\$ Pointing UVs directly to the texture atlas on a modeling software did the trick, but changing the material coordinates in a script just created another instance of that material(no batching). \$\endgroup\$
    – Esa
    Commented Aug 13, 2013 at 5:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .