I think I have basic problem to understand performance about instanced materials.
I made a Master Material (Brick). Then, I created some instances and tweaked some parameters to get several kind of bricks.
The instances are working so good but if I see the ‘Size Map’ option it seems like the instances are more expensive than create a new material from scratch because instances use default textures from master material and new textures from instance.
However, If I go into my project and take a look to the materials.uasset, the instances seems more cheaper than the master material.
I know instanced materials are usefull and we can make all kind of tweaks without incurring an expensive recompilation of the Material, but I don’t understand why the ‘Size Map’ option show me that an Instanced Material can be more expensive than a ordinary material.
The size map tools just shows you the size of all the referenced assets on disk, it does not directly indicate run-time memory usage. For example, in this case you see it references its master material. The textures nested inside the master material are referenced by the master material itself. That does not mean that all these textures are loaded when your game is running and even the ones that are used will be streamed in, so the larger mipmaps might not even be in memory.
A more useful way to find out which textures are eating up your memory is to Texture statics viewer. (open window>statistics and set it to texture stats) This will show you all the currently loaded textures and their memory costs.
After that I created some instances and I changed the default normal map to a specific normal map. If I check Texture Stats on each instance, I get this:
So looking at the numbers I assume “T_Brick_Clay_Beveled_N” is used on the instanced and “T_Detail_RockyTest_N” is the one you have as the base?
Either way, one of them is a 1024² texture and the other is 2048². You do realise that a bigger texture resolution causes a bigger impact on the memory, right?
Yes, you are right. My question here is… why the instance is using the base texture and the instanced texture? I mean, Should not it use only the instanced texture?
Right now, I understand that the Base Material is using 1,365 Mb and the instances are using 6,826 Mb both of them, so I don’t find the advantage of using Instanced Materials if they use more memory than the base material. Maybe, I just don’t understand how ‘Texture Stats’ is working, so that is the why I am asking some help.
Yes, I know and I agree with you. Again, that is the why I don’t understand why an instanced material is using more memory than Master material. Are not the instanced materials causing a bigger impact on the memory?
Ohhh now I get what’s going on on the pictures. That is indeed weird. But sadly it also goes above my head. I hope someone can clear that up, because now I’m also interested.
Going to bump this from 2016 because this happens to me all the time and I still don’t know whats going on?
Especially with more complicated instances it makes the statistics pretty much useless. Anyone know what i’m doing wrong?