- Home /
Best way to implement texture atlas for objects sharing the same mesh?
I have a bunch of environment assets, for instance a group of wall assets named wall1, wall2 etc.
These wall assets all share a single mesh (let's call it wall.fbx), but use a different texture. Before, I simply had a few separate materials with different textures and assigned them to the individual wall assets, but to reduce draw calls I want to use a texture atlas instead.
I've combined all the environmental textures into a single texture map and a single material, which in itself works fine, but now I have to export out separate meshes (wall1.fbx, wall2.fbx etc.) so that the UVs can be different for say, wall1 and wall2. This seems like a badly optimized solution since now I need multiple mesh assets where previously I only needed one.
Is there a better way to do this, perhaps change the UVs for a specific mesh instance in Unity somehow? I see no easy way to do this within the editor aside from overriding the UVs in the material which would defeat the purpose (since I only want a single material to begin with).
Go ahead and use the multiple, imported mesh method. If you were to alter the UV's in Unity, ideally it would be done in the editor, in which case you would end up with a saved, altered instance of the mesh anyway. $$anonymous$$aybe if you could alter the mesh and save it as a prefab, without requiring an additional .fbx? As far as I'm aware that is not possible though, since the $$anonymous$$esh Renderer would require $$anonymous$$esh data, you would probably require creating a additional $$anonymous$$esh instance.
Regardless, you would probably create the same number of prefabs, non of which would affect your in-game performance. Lastly, you would, probably, want to combine meshes to further reduce draw calls, which would require changing the UV coordinates, again.
Thanks for the reply - I will use the multiple meshes method. :)
Your answer
Follow this Question
Related Questions
Texture vs. Material 0 Answers
Procedural mesh generation, problem with textures 1 Answer
multiple textures on one mesh + different Albedos 1 Answer
Get texture with UV Mesh Mapping 0 Answers
vrchat model issue - Flashing red and yellow lights 0 Answers