Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tibithegreat

Pages: [1]
1
Support / Re: Sprite Collections and you...
« on: April 17, 2014, 01:16:17 pm »
Sprites that are in the same collection are usually packed in the same atlas texture. This means that unity will be able to easily batch the draw calls for multiple objects if they are in the same collections (because they share the same texture).

You have to trade-off memory for performance basically. If you put all the sprites in the same collections you will have better performance because opengl won't have the unload the texture and load the new texture every time. It will just load that one texture in memory and use it for every draw call. The disadvantage here is that there may be cases where you want to draw one specific object but you will load the whole atlas in the video card memory even though you only use like 5% of it.

2
Hi,

We've been using tk2d a lot in our game to display the art objects and we created a lot of collections to group the sprites so that it would be easier for level designers. However we are currently having some issues with memory. Investigating we figured that we were loading a lot of atlases for one or two small sprites (and the atlas contained a lot more sprites which were not used in the level). So we figured we should try moving the sprites around to stop this from happening (remove some of the redundant objects that we are loading). The problem at hand right now is this:

Can we move the sprites from one collection to another without affecting the current objects? From what I see tk2dsprite component stores the spriteid and uses that one for reference inside the collection.

The current idea I have to do this is to do a script which will rename the gameobjects using tk2dsprite and store the name of the sprite inside the gameobject's name, then we manually move the sprites around, and then try to see in which collection each sprite ended up and update the objects. However before I do this I would like to know if there isn't a better way to do this.

Pages: [1]