Hi there,
which way has a better performance? My experience:
Pro/Con UV-Animation
- Every gameObject can have same material (static batching)
- Every gameObject can have different frame from texture-atlas
[/COLOR]
- Every gameObject need to have a separate animation script (or at least on script has to store every mesh)
- Calculation is more expensive
[/COLOR]
-
Pro/Con TextureOffset-Animation:*
-
Just one script has to store the shared materials and change their offset (faster calculation)
-
Less static batching than with uv-animation
- GameObjects which should have another atlas-object has to have another material
- Every gameObject with the same material had the same frame (only visible on low framerate; when you pause in editor; if you have slow animations)[/COLOR]
I’ve made some tests in the editor and on my iPad1. You can see the editor results below:
UV-Animation: (on iPad1, FPS: 19)
Texture Offset-Animation: (on iPad1, FPS: 30 - targetFrameRate)
With TextureOffset I got twice the FPS than with UV-Animation. (iPad not, because of targetFramerate);
DrawCalls are the same, because I don’t used an atlas for this short test.
I know the major difference would be, that with texture offset animation, every gameobject has the same frame, but that doesn’t matter in my case. It could be worth testing whether it’s better to use more materials with the same atlas, but let different scripts change their offset and monitor whether it’s still faster than uv-animation.
If you have further information/recommendations or experienced different behaviours (e.g. on android devices), please let me know.
Thomas