Hi all,
I can see I need to reduce my draw calls. But I am unsure how to do this. Suppose I have 10 models each with 1 material (i.e. they have been baked in blender). How do I then combine these 10 textures into 1 to reduce my draw calls. Do I ‘somehow’ do this in Blender (but then that means a prefab has to be baked per level as it could be mixed with other different prefabs). Or so I do something in Unity?
Any help appreciated
Cheers
You have 2 main options that I can see:
-
In Blender place all UV maps into 1 Texture. This requires grouping your objects into specific textures in ways in which they are likely to be seen together, and must be done at model time.
-
In Unity create a basic API that uses Texture2D.PackTextures() and warps the existing model UVs as some sort of Editor process. Basically you would select X amount of models and it would take their materials’ textures and combine them into one larger texture using Texture2D.PackTextures(). Then you would take the new UVs for each texture and distort the models UVs to fit within the new subset you are given (i.e take the original 0-1 UV values, and if the texture fits into the lower 25% of the packed Texture you put them into a 0-0.25 space). Then you save your new Material and assign it to the models and re save the Models with the new UVs from within the Unity Editor.
Hi ntero,
This is what I thought!!!
Option 2 sounds best as it is dynamic.
Is there no such script or plugin that achieves this already ?
It seems like a common requirement on iPhone and android ? - perhaps it will be introduced in unity 3.5 
Any example scripts would be appreciated
Thanks
Some of the 2D tools that are on the Asset Store will do batching for you, and I’ve worked on some tools for run time batching, but there are no tools that pop into my head for 3D.
PackTextures() does the actual alignments which was a pain to do externally, so it shouldn’t be too complex after that.