Download

About materails memory compsumition

This is a doubt I have for a long time. For example in this image you can see that I have one texture and two materials that are exactly the same, but with different values in the texturecoordinate node:

texturememory.jpg

The texture is 1,33 Mbytes, and the two materials are 2 Mbytes, each.

What is the final memory compsumition in the game cooked, 1,33 Mbytes for the texture and a few bytes per each material? Or what the content browser shows, 1.33 + 2 + 2 Mbytes?

I’m using diferent materials that are basically the same, but with different texture coordinate values. If each one includes the same texture… it’s a lot of memory wasted.

Why not use a material instance instead of a second material since its only some texturecoords you changed, What you would have to do is after your texture coord mask R and G and multiply R with one scalar and G with another scalar then append their end result and hook it into your texture.

Then inside your material instance change the texture coord values to your liking. (remember to input a default value of 1 on your scalars and name accordingly.)

Wouldn’t that make it the cheapest you can get?

Yes, I was thought about using material instance, but that don’t resolves my doubt.

My reply is on the optimization side and not so much directly related to your question.
I am guessing here that your final scene cost provided you use both those materials in your scene would be 2+2mb as the texture is already calculated as a cost inside those Materials, I could be wrong its not my area of expertise.

memory-wise it’s still 1,33 MB. the material simply accesses the texture on memory but won’t duplicate it

Sounds the most logic. Anyway I will use more the material instances as Diebyzer0 says. Thanks!