Material Editor Questions

I want to make a material (instance) that combines many different texture samples using Parameters and Lerps

To keep the wires from becoming spaghetti I would like to drag 20 copies of the base material that will be combined

Does dragging the same exact texture sample in 20x increase the memory foot print or does the engine know that it is the same thing and only load it once.

Also…

I set up one material instance by blending two samples, it looks fine in the material editor and in the level editor.

When I play as stand alone the portion I combined is really blurry and only gets clearer if I get really close to it and wait about a few seconds
then it pops gets a little clearer but is still blurry it does this a few times, and if I wait longer and longer eventually it is perfect.
There is none of this behaviour on the rest of the material just the portion I combined.

Does anyone know what is causing this?

Check the size of youyr texture streaming pool.
Sometimes the scalability settings mess around with that.
Increase the pool size and it should be better.

Thanks,

It is wierd it doesn’t happen in VR or the editor or persona just in standalone. I will check the texture streaming pool.

Do you have any idea about the other question. If I drag and drop the same exact texture sample into the material editor 20x
does it increase the memory footprint of does the engine know it is the same and not care how man times I copies of the same texture sample I have in the material editor

The code it generates is different, in terms of local variable assignment.

Both of these produce the same final output. The first uses 4 identical copies of the same sampler node, the second uses one.


MaterialFloat4 Local0 = 
   ProcessMaterialColorTextureLookup (Texture2DSample \
(Material.Texture2D_ 0, Material.Texture2D_ 0 Sampler, 
       Parameters.TexCoords[0].xy));
 MaterialFloat4 Local1 = 
   ProcessMaterialColorTextureLookup (Texture2DSample \
(Material.Texture2D_ 0, Material.Texture2D_ 0 Sampler, 
       Parameters.TexCoords[0].xy));
 MaterialFloat3 Local2 = (Local0.rgb + Local1.rgb);
 MaterialFloat4 Local3 = 
   ProcessMaterialColorTextureLookup (Texture2DSample \
(Material.Texture2D_ 0, Material.Texture2D_ 0 Sampler, 
       Parameters.TexCoords[0].xy));
 MaterialFloat3 Local4 = (Local2*Local3.rgb);
 MaterialFloat4 Local5 = 
   ProcessMaterialColorTextureLookup (Texture2DSample \
(Material.Texture2D_ 0, Material.Texture2D_ 0 Sampler, 
       Parameters.TexCoords[0].xy));
 MaterialFloat3 Local6 = (Local4 - Local5.rgb);
 MaterialFloat3 Local7 = (Local6 + Material.VectorExpressions[1].rgb);




MaterialFloat4 Local0 = 
  ProcessMaterialColorTextureLookup (Texture2DSample \
(Material.Texture2D_ 0, Material.Texture2D_ 0 Sampler, 
      Parameters.TexCoords[0].xy));
MaterialFloat3 Local1 = (Local0.rgb + Local0.rgb);
MaterialFloat3 Local2 = (Local1*Local0.rgb);
MaterialFloat3 Local3 = (Local2 - Local0.rgb);
MaterialFloat3 Local4 = (Local3 + Material.VectorExpressions[1].rgb);

Thank you. That cleared it up. The code looks pretty bad after dragging the same material in multiple times
It looks like it might also make a function call when assigning the variable.
I will drag it in just once and try to organize it

Thank you