- Home /
Working around Texture2D.Apply() performance issue
Hi,
I'm trying to find with a workaround to well known performance problem of Texture2D.Apply(). I've come up with an idea, but it has some flaws, which bothers me.
Idea is simply to create big Texture2D from multiple smaller Texture2Ds. Because I modify really small number of pixels per frame, in that approach I wouldn't need to call Apply() on big Texture2D, but only on that parts of it, which I would change. But the problem is, when I want to display them on screen together. They are arranged in a grid (e.g. 512x512 = 128x128 16 times). Since GUITexture can hold only one Texture, I have to use 16 GUITexture Components. And GameObject can hold only one GUITexture, so there are 16 GameObjects.
And if I'd like to have bigger texture and/or smaller sub-textures, this number grows. And then, I wanted to display such big-texture for a group of real GameObjects in game, lets say 50 of them. So it would be 16 * 50 = 800 (or much much more). This fast growing number bothers me. I feel that so many GameObjects could also kill performance. Is there any better way to solve this? Can my approach be modified so it would look better?