Announcement

Collapse
No announcement yet.

Best Practice for Multiple Materials? Materials Functions or Element Slots?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Best Practice for Multiple Materials? Materials Functions or Element Slots?

    Im making a building that's going to be using multiple materials, concrete for the ground, metal for the door handles, wood for the walls etc.

    What is the best and most optimized approach to do this? Do I use one material that contains multiple material functions? Assign material elements slots to the mesh? Or a mix of both?

    Click image for larger version  Name:	Annotation-20191019-213435.gif Views:	2 Size:	321.5 KB ID:	1675620


    My current approach is layering material functions but it looks like I'm limited to only 4 materials (seperated by a RGBA mask) and anything after 4 gets much more expensive (I'm using a Color-Select function to mask out custom colors). Is it more efficient to use 2 sets of texture masks perhaps?

    Click image for larger version  Name:	Annotation-20191019-213600.gif Views:	2 Size:	138.0 KB ID:	1675621

    What is the best and most optimized approach to tackle these architectural element materials? How can I keep things optimized with more than 5 materials?

    #2
    With some exceptions, you're almost always better off using separate material slots rather than a single material that tries to accommodate a bunch of different surface types. Using an extra material slot will add draw calls, but avoiding that by using a "layered" material essentially prevents the GPU from knowing which "layer" will be drawn until the pixel shader is already being executed. In practice that's usually much more of a bottleneck than the additional draw calls, plus it's usually much cleaner from a workflow perspective to have material assignments stored as part of the static mesh itself.

    Comment

    Working...
    X