animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.87k stars 317 forks source link

Importing Textures into Unity #316

Closed seularts closed 8 months ago

seularts commented 3 years ago

Unity is a pain to work when it comes to importing external textures. After I have generated the character and imported the FBX model into Unity, I extracted the Materials and then I have manually imported the Textures to associate them manually. The "Extract Materials" is not an available option for some reason. I have 2 main issues:

  1. The Cornea Texture/Material covers the entire eye color and I can't seem to bring out the Iris Material on top.
  2. I do not know in which channels to connect the frekle, lipmap and sebum textures into the skin material in Unity.

If you could give me some guidance in this regard it would help me so much. Thank you!

animate1978 commented 3 years ago

Sadly I do not have Unity on my system, I use Ubuntu at the moment... so I don't have experience with this particular engine.

As for the eyeball textures, the mesh that is the cornea could be a transparent material as this mesh is only designed for "realism" purposes. Making it transparent I think would solve your problem but again as I am not experienced with Unity I cannot give you a way to solve this directly.

The freckle, lipmap and sebum texture maps are masks for Blender materials and are specific for EEVEE and Cycles so you would need to go into Blender and open up the shader to see the network in order to correctly duplicate this in Unity.... I would imagine Unity would have a node based shader system? If not then it would be impossible to really take advantage of the masks. Again I have no experience with Unity.

I am sorry if this is not much help?

seularts commented 3 years ago

Thank you for the reply. Yeah, Unity does have some nodes but they are no near as performant as blender, so I just had to fiddle around. I did manage to fix the eyes a bit by adding the eyes_albedo texture on the cornea and that acts as a sort of mask for some reason (in case anyone hits the same issue as me in Unity), but the eye color still isn't editable (they are just black and glosy irises). At the end of the day it's just Unity not coping with what Blender does, but at least now I understand these limitations better.

Keep up the good work, you guys are the best :)

ldo commented 3 years ago

Transparency should not be a difficult thing for any game engine to handle. It’s just an alpha value in the texture pixels.

seularts commented 3 years ago

You are right, there is a transparency hidden really well. You actually have to click on the color to modify the alpha after the rendering mode is set to transparent, but Unity doesn't make this clear at all since it has an option called Albedo Alpha that doesn't affect transparency in the normal way. So yeah, I found the fix! Thank you!