Materials, Textures and Memory Usage

Hey,

TL;DR question: Having multiple materials pointing to the same texture… duplicates that texture in the memory? (this seems to be the case, would like some confirmation)

My problem is the following: I have multiple particle systems for spells and so on, like in any game. However I have a small system for creating partcles which include models as particles as well, as they are more flexible than only particle systems. So basically each spell effect in the game is a combination of real shuriken particle systems, and models with they own textures. These models however sometimes change their textures in some way, like the color or alpha, which transforms their materials into an instance, a new material. This has the performance hit of multiple drawcalls… but apparently my memory consumption is skyrocketing as game goes by, and I am thinking this here is the reason, therefore, the question at hand.

So, is this the expected behaviour? couldnt unity reference the same texture regardless of how many different materials are using that texture?

Thanks

In the profiler is a memory subpart that differentiates between texture memory and some other categories, check that out.

Are you also calling Object.Destroy on these instantiated materials when you’re done with them?

PS: textures should not be instantiated when instantiating the material as far as I know.