NokiMo
modelcorner
modelcorner

patreon


(Clickbait) Mai’s ‘hidden’ ‘feature’

Hey guys! I would apologize for the clickbait title, but since I preemptively mentioned it, that absolves me of any fault :D

So, I wanted to talk a little about Mai’s ‘hidden’ ‘feature.’

Is not really a feature because it’s nothing new that improves the performance of the model and is not really hidden if you check the files.

I wanted to talk about this right after I released Mai, but I honestly forgot about writing it until today, so, let’s talk about it!

File Structure.

In regular circumstances, you will find two types of files in the Materials folder that work with each other:

Models use a shader called VertexLitGeneric, which is defined in the VMT material. However, if you look at Mai’s Materials folder, you will find three types of files that work with each other:

What the hell is MAT? Well, that’s why I’m here to talk about it!

Backstory.

Some time ago, I asked LordAardvark if there was a way to include parameters in one material from other materials in order to save time in writing VMTs. He then pointed me towards a Shader and proceeds to confirm me that yes it is possible as he uses that for DOAF. Now, I’m going to tell you the truth in the same way I did to him: All I wanted was trying to chat for a bit. I didn’t expect this to be possible because I thought there wasn’t such a parameter like “$include”.  

Introducing: ‘Patch’ Shader and Material Files.

Out of the wiki: Patch is a special shader that allows materials to inherit from each other.  

It looks like this:

Patch

{

include “material_path.format”

insert

{

$parameter “Value”

}

}

The parameters inside the Insert keys are the ones we want to add to our VMT. If the parameter already exists, then it is overridden with the parameter of our VMT. This is so we can be sure we are using the same material parameter values across different materials. Thanks to this, we can now use the following setup:

The only limitation I seem to find, is with hair textures. I don’t know why, but I was unable to inherit the values from a double mesh hair from a specific Material.

This is how a setup looks like: on the left side, you will see how a VMT looks like, and on the right side, you will see how a MAT file looks like.

I wanted to give it the MAT name for two reasons:

How the hell does this benefit me?

You may ask that. Well, it depends really, but there’s one huge reason why this can be beneficial not for me, but for content creators:

This may be or may be not useful for all content creators, but I’m pretty sure people messes with the phong values from time to time, so now they can have an easier time messing with them.

I hope you guys find this ‘feature’ useful! Remember to wash your hands!


Related Creators