- Home /
Texture Atlas for sprites/particles: Wasting Texture Memory?
I have several different particle images that I've combined into one texture atlas. However, during run time all the particles varies in size and color -- I am well aware of the cautions about material cloning and when that happens.
My Question: When materials are cloned at run time and/or when I have different materials that uses portions of the same texture atlas but with different color tints, alpha ,etc -- am I duplicating that texture in memory?
In other words, if I have a part of that texture atlas that's has a 64x64 particle image -- and the entire texture atlas is 1024 x 2014; and when I use different colors for that particle am I wasting memory because the entire atlas is being duplicated just for that one 64x64 portion?
Another example is what if I combine my game player sprites and particles into a single texture atlas? And the sprites are rendered in their original colors what the particles have various colorings and alpha?
Thanks, for clearing it up. Manny
Thanks for the reply.
There was a lot of info in your reply but I guess the key take away here is that the texture is not duplicated in memory. Am I reading you right?
Sorry to be dense but this is something I want to make sure I'm absolutely clear on.
Thanks.
Answer by Enum · Jun 05, 2015 at 07:12 PM
I can not answer your question for sure, but: Create a new shader file in unity editor and look at the code: Even this little example code does multiply the texture color with the tint color that was set in the material. So the texture is not copied and modified but the color value is considered during shading. I would be irritated if the standard shaders would take a different approach.
If I'm wrong I would be glad to be corrected by someone with definite knowledge, but as this question was unanswered so long I gave my guess.