Disposing Materials

When optimizing the scene object I noticed my materials were being optimized with nice low count but the texture count remained high.

I have created a PG here to see if this would happen outside my ecosystem.


The material being disposed does kick off the texture but it comes back again, over and over?

Is this a bug? or expected behaviour?

1 Like

Hey there, it looks like the issue is that you’re disposing the material but not the texture. If you pass true as the second param to material.dispose() then it will dispose the texture as well, after which the texture count is 0. :slightly_smiling_face:

PS, if you use the Inspector it’s an easier and I think more reliable way to track the textures.