#Merge materials into a single material at runtime

1 messages Β· Page 1 of 1 (latest)

light lake
#

Hey! Looking for some optimization magic here! I have a character customization system where the player can pick out clothes (shirts, pants, shoes, hats, etc). All of these items have their own material slots, which means each have their own draw calls. Is there any way that I can get the materials from the items the player picks and somehow merge them all into a single material so that there is only one draw call? Or at least reduce the amount of draw calls to an extent.

gaunt thunder
#

i fear if that were possible this method and its tutorial wouldn't exist

#

Big systems require big explanations... I hope you've got a drink and a snack because this feature-length Development Log doesn't slow down!

In this video we take a look at my last month of work, creating a robust character customization system so that Prismatica can be full of unique and colourful characters. This system also allows for indivi...

β–Ά Play video
wintry zinc
wintry zinc
#

You. Could use a big virtual texture

#

You could use texture array

#

The character merging plug-in I'm using allows you to shift or scale the UV per mesh

#

So there are a lot of ways to do this depending on how many different things you need to account for

gaunt thunder
exotic burrow
#

Make a big Virtual Textures, you’re looking for a UDIM, and manipulating the bigger part of the UV values so that you can select the texture.

wintry zinc
#

Yes that's what I was suggesting

#

But if you use mesh merge you literally don't need to change the material at all

#

All these characters literally have this material

#

There is no math, a single texture sampler

#

And they can be produced in many combinations

#

Probably some 4 thousand something combinations I don't remember exactly