Gildor's Forums

Author Topic: How to import/render hair in Blender from UE4 models and MAT.props.txt?  (Read 302 times)
CharlieTemplar
Newbie
*
Posts: 4


View Profile
How to import/render hair in Blender from UE4 models and MAT.props.txt?
« on: September 03, 2019, 15:16 »

Grabbed a couple of models from a UE4(.20) game and having trouble understanding how the Hair, Eyebrows and eyelashes are done and how to render them properly in Blender.
Got 3 texture files that look like they should be used as transparency masks but can't figure out how to use them.
The MAT.props.txt seems to describe how these should be used, but the description doesn't make sense to blender.  How can the material props txt files be used/interpreted?  OR How do I use the Opacity image as a mask for hair?
The mesh is blocky but I think this should render to frizzy "clown" hair


Code:
Diffuse=Hair_BC
Opacity=hair_O

Code:
ScalarParameterValues[14] =
{
    ScalarParameterValues[0] =
    {
        ParameterName = None
        ParameterValue = 1
        ParameterInfo = { Name=AO Amount }
    }
    ScalarParameterValues[1] =
    {
        ParameterName = None
        ParameterValue = 1
        ParameterInfo = { Name=Brightness }
    }
    ScalarParameterValues[2] =
    {
        ParameterName = None
        ParameterValue = -1
        ParameterInfo =
        {
            Name = EdgeMaskContrast
        }
    }
    ScalarParameterValues[3] =
    {
        ParameterName = None
        ParameterValue = 2
        ParameterInfo = { Name=EdgeMaskMin }
    }
    ScalarParameterValues[4] =
    {
        ParameterName = None
        ParameterValue = -2
        ParameterInfo = { Name=MipBias }
    }
    ScalarParameterValues[5] =
    {
        ParameterName = None
        ParameterValue = 0.5
        ParameterInfo =
        {
            Name = PixelDepthOffset
        }
    }
    ScalarParameterValues[6] =
    {
        ParameterName = None
        ParameterValue = 0
        ParameterInfo =
        {
            Name = RandomHueVariation
        }
    }
    ScalarParameterValues[7] =
    {
        ParameterName = None
        ParameterValue = 0
        ParameterInfo =
        {
            Name = RandomValueVariation
        }
    }
    ScalarParameterValues[8] =
    {
        ParameterName = None
        ParameterValue = 1
        ParameterInfo = { Name=Roughness }
    }
    ScalarParameterValues[9] =
    {
        ParameterName = None
        ParameterValue = 0.1
        ParameterInfo = { Name=Scatter }
    }
    ScalarParameterValues[10] =
    {
        ParameterName = None
        ParameterValue = 0.4
        ParameterInfo = { Name=spec mult }
    }
    ScalarParameterValues[11] =
    {
        ParameterName = None
        ParameterValue = 1
        ParameterInfo = { Name=TipPower }
    }
    ScalarParameterValues[12] =
    {
        ParameterName = None
        ParameterValue = 1
        ParameterInfo =
        {
            Name = VertexColorStrength
        }
    }
    ScalarParameterValues[13] =
    {
        ParameterName = None
        ParameterValue = 0
        ParameterInfo =
        {
            Name = RefractionDepthBias
        }
    }
}
TextureParameterValues[7] =
{
    TextureParameterValues[0] =
    {
        ParameterName = None
        ParameterValue = Texture2D'hair_O.hair_O'
        ParameterInfo = { Name=Alpha }
    }
    TextureParameterValues[1] =
    {
        ParameterName = None
        ParameterValue = Texture2D'Hair_R.Hair_R'
        ParameterInfo = { Name=AO }
    }
    TextureParameterValues[2] =
    {
        ParameterName = None
        ParameterValue = Texture2D'hair_D.hair_D'
        ParameterInfo = { Name=Depth }
    }
    TextureParameterValues[3] =
    {
        ParameterName = None
        ParameterValue = Texture2D'Hair_BC.Hair_BC'
        ParameterInfo = { Name=Diffuse }
    }
    TextureParameterValues[4] =
    {
        ParameterName = None
        ParameterValue = Texture2D'hair_R.hair_R'
        ParameterInfo = { Name=DyeMask }
    }
    TextureParameterValues[5] =
    {
        ParameterName = None
        ParameterValue = Texture2D'hair_R.hair_R'
        ParameterInfo = { Name=Root }
    }
    TextureParameterValues[6] =
    {
        ParameterName = None
        ParameterValue = Texture2D'hair_D.hair_D'
        ParameterInfo =
        {
            Name = Unique_Hair_Value
        }
    }
}
VectorParameterValues[5] =
{
    VectorParameterValues[0] =
    {
        ParameterName = None
        ParameterValue =
        {
            R = 0.041667
            G = 0
            B = 0
            A = 1
        }
        ParameterInfo = { Name=RootColor }
    }
    VectorParameterValues[1] =
    {
        ParameterName = None
        ParameterValue = { R=0, G=-1, B=0, A=1 }
        ParameterInfo = { Name=Tangent }
    }
    VectorParameterValues[2] =
    {
        ParameterName = None
        ParameterValue = { R=0, G=0, B=0.3, A=1 }
        ParameterInfo = { Name=TangentA }
    }
    VectorParameterValues[3] =
    {
        ParameterName = None
        ParameterValue = { R=0, G=0, B=-0.3, A=1 }
        ParameterInfo = { Name=TangentB }
    }
    VectorParameterValues[4] =
    {
        ParameterName = None
        ParameterValue =
        {
            R = 0.364583
            G = 0
            B = 0
            A = 1
        }
        ParameterInfo = { Name=TipColor }
    }
}
Parent = Material3'Julia_Hair_Master.Julia_Hair_Master'
BasePropertyOverrides =
{
    bOverride_BlendMode = false
    BlendMode = BLEND_Masked (1)
    bOverride_TwoSided = false
    TwoSided = true
}
FlattenedTexture = None
MobileBaseTexture = None
MobileNormalTexture = None
bUseMobileSpecular = false
MobileSpecularPower = 16
MobileSpecularMask = MSM_Constant (0)
MobileMaskTexture = None









« Last Edit: September 04, 2019, 13:40 by CharlieTemplar » Logged
CharlieTemplar
Newbie
*
Posts: 4


View Profile
Re: How to import/render hair in Blender from UE4 models and MAT.props.txt?
« Reply #1 on: September 03, 2019, 15:29 »

Similarly for eyebrows and eyelashes.  Here I have applied the texture, but how do I mask so only the hairs hare shown?  Transparency doesn't work...
« Last Edit: September 04, 2019, 13:39 by CharlieTemplar » Logged
Blenux
Moderator
Hero Member
*****
Posts: 778


Welcome to Gildor Land.


View Profile
Re: How to import/render hair in Blender from UE4 models and MAT.props.txt?
« Reply #2 on: September 03, 2019, 16:35 »

Where there is black = transparency, where there is white = shown geometry, you plug  the transparency mask (black and white) into the alpha of the principle shader and turn on Alpha Clip (or Blend) in the Material settings if using Eevee (Cycles no need to), put a math node on the line node of the alpha to be able to control the transparency.

(Click Picture to Enlarge)


Please use thumbnail links next time like mine shown (quote this to see the link)
« Last Edit: September 03, 2019, 16:37 by Blenux » Logged

Blender User.
Rip Game Content to learn stuff.
Like to help people in general.
CharlieTemplar
Newbie
*
Posts: 4


View Profile
Re: How to import/render hair in Blender from UE4 models and MAT.props.txt?
« Reply #3 on: September 03, 2019, 22:41 »

Great, thanks!!
I missed the Alpha Blend option...

The hair seems thinner than it should be tho...

« Last Edit: September 04, 2019, 13:39 by CharlieTemplar » Logged
CharlieTemplar
Newbie
*
Posts: 4


View Profile
Re: How to import/render hair in Blender from UE4 models and MAT.props.txt?
« Reply #4 on: September 04, 2019, 05:26 »

The Alpha Hashed option works better for this one, without messing with transparency, tho Cycles (left) looks like he has been touching up his roots with Mascara...  Seems like cycles isn't as smooth with transparency


Still fighting with the Frizzy hair, not able to get it to look right... too "blotchy" like dredds with Cycles, and too thin and sparse with Eevee...


« Last Edit: September 04, 2019, 13:39 by CharlieTemplar » Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS