Page 1 of 1

Need help forming the .mhmat file

PostPosted: Mon Apr 09, 2018 12:52 pm
by learning
As you may know, from time to time I take objects from freely (as in "free beer") available game models to convert them into MH assets and post here into my "scavenger" thread viewtopic.php?f=4&t=13316

Recently, I was looking to "scavenge" a haircut that would look natural specifically for Asian female characters. After spending quite some time searching I was able to discover one that seems to work perfectly. It comes from a character named Makoto Makimura from a game called Yakuza 0: https://cunihinx.deviantart.com/art/Mak ... -726015668

The "ripping" process went sufficiently well, and the final look of the asset I found satisfactory:
preview.png

You can find the asset attached so that you can experiment with it as well.

However, correct arrangement of textures is something that I couldn't handle by myself in this case. You see, the original object has 4 textures:

c_aw_makoto_hair_di.png is set up like a normal diffuse texture with alpha influence (the material itself is completely transparent):
c_aw_makoto_hair_di-setup.png
c_aw_makoto_hair_di-setup.png (28.1 KiB) Viewed 8280 times


c_am_tachibana_hair_h2.png is special: it is set similarly to the first one, but its Blend mode parameter has to be set to Multiply rather than Mix. Failing this would lead to disastrous effect on the overall look of the asset. The setup is like this:
c_am_tachibana_hair_h2-setup.png
c_am_tachibana_hair_h2-setup.png (29.04 KiB) Viewed 8280 times


c_aw_makoto_hair_tn.png is a normal map, so it is to be set up as one would expect of the normal map:
c_aw_makoto_hair_tn-setup.png
c_aw_makoto_hair_tn-setup.png (21.94 KiB) Viewed 8280 times


c_am_tachibana_hair_sp.png is a specular map, it should be set up as a specular map texture:
c_am_tachibana_hair_sp-setup.png
c_am_tachibana_hair_sp-setup.png (28.89 KiB) Viewed 8280 times


I listed the textures in the same order they were present in the original file. I am not sure if changing the order is going to change anything, but I always apply them in this order just to be on the safe side.

And so, I find my knowledge of .mhmat format syntax insufficient to be able to form a file that would make such a quirky texture setup understandable for MakeHuman and/or MHX2 exporter. Can anyone help me with this?

Re: Need help forming the .mhmat file

PostPosted: Thu Apr 12, 2018 2:52 am
by MTKnife
You probably need to "bake" the object in Blender to collapse the first two textures into a single one. The normal and specular maps should work just fine, though normal maps don't show up in MH.

Re: Need help forming the .mhmat file

PostPosted: Thu Apr 12, 2018 3:09 pm
by learning
Could you elaborate? I have seriously no idea how to bake textures and how it can even help.

Re: Need help forming the .mhmat file

PostPosted: Sat Apr 14, 2018 1:58 am
by MTKnife
You'll find a *bake* option towards the bottom of the render tab of the object menu (in Blender Render--I'm not sure if there's a Cycles equivalent). When you use that option (assuming you have a UV map), Blender renders the object and then maps it into a texture window, from which you can save it. It is going to render using the current lighting and all other settings, so it's not a perfect solution, but it lets you combine textures in MH, or do other useful things, such as storing procedural textures or those created by repeating pictures.

Re: Need help forming the .mhmat file

PostPosted: Sat Apr 14, 2018 3:38 am
by loki1950
And yes the bake option is there with the cycles render engine and for the OP there are lots of blender tutorials on baking either on YouTube or as a general google search.

Enjoy the Choice :)

Re: Need help forming the .mhmat file

PostPosted: Sun Apr 22, 2018 9:26 pm
by learning
It took some research, but I think I got it. Here I recreated the asset using baked textures (three separate bakes for diffuse, normal and specular). Please look and tell me if it works ok for you.

If the results are satisfactory, this baking stuff can be a really powerful technique. With it I can scavenge also the assets that are more than one object and/or more than one material.

Re: Need help forming the .mhmat file

PostPosted: Mon Apr 23, 2018 3:53 am
by MTKnife
You shouldn't need to bake in specular, since MH handles that one as a separate texture already (I think?). What to do with normal texture depends on what you need it for: if you need it to show up in MH, yes, you need to bake it, but if you only care what it looks like when exported, don't bake it.

Re: Need help forming the .mhmat file

PostPosted: Mon Apr 23, 2018 8:25 am
by learning
I had to do all three because I had to make a new UV map, and MH can only handle one. Please tell me if the result works for you.