Do Layered Material Instances cost as much as Materials? (in terms of shader compilation)

So my scene has 1000 unique static mesh objects, and there are ~10 materials shared among them. I’m going to convert the system to use unique material instances for every single object, all of which will use Material Layers. I think this is okay because:

1 This would not increase draw calls at all since, even if i share materials between objects, they are still treated as separate so i will always have 1000 draw calls at best.

  1. Im still safe in terms of memory because I will only be using a total of ~20 textures shared between all these materials.

… The main question is will this incur enormous shader compilations or are material instances which use layers a lot faster / smaller than regular materials?

Are all those materials same type? Like all are wood, stone, wall etc? Can all of them be rendered by same master material?

Asking because i have idea:

  • make master material that uses Atlas texture. like 8192x8192 that is split in 4x4 atlas, so each tile would be 2048x2048.
  • then you can use flipbook node to set index of what cell/tile you want for material.
    That would make most of your materials into same shader/material.

Material Layers are nice when you have some different types of layers. For eg. Snow, grass water. While snow calculates based of angle of surface to up vector. Grass would check for open and mostly flat areas (and use some noise texture) and water/wet would check for height range. So for mixing in different ways yes use layers.

ps.
those 20 textures are different surface types (all with diffuse, ambient and normal textures), or those are 20 textures (about 6 different surfaces, each having 3 textures).

Yeah so thats more what my current system is, but I want to support more varied materials now like stacking an arbitrary pattern (dots, strips, grooves) onto a base material like copper so thats why I was looking to upgrade the system to layers since i didn’t want to hard-code patterns or more assumptions into my master material.

Then make layered materials. And add different mixing/blending material layers.

You can also add more ways of blending in single material that uses static switches. Static switches help with creating same material for multiple versions of it, that helps in non layered materials/shaders, not sure if its true for layered.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.