Home Technical Talk

XGen Eyelashes/Eyebrows - Best Way to Convert to Hair Cards?

polycounter lvl 4
Offline / Send Message
Pinned
ChristheLancer97 polycounter lvl 4
Hello,
I'm trying to bake converted xGen Hair to Geometry Eyebrows/ Eyelashes, into a Normal Map and Alpha Mask on Marmoset Toolbag 4 for better hair accuracy.


But the problem is that nothing gets baked. I've manipulated the cage several times but the normals appear blank on Marmoset, the result is there below. 

I've also went into Substance Painter to bake them, while it does work it comes out fairly janky all the time, even with 8K baking resolution on, because of what I assume are the intersecting hairs. 

My question is, what's the best way to bake xGen hair onto Planes where I can get good results? The best I've tried is to just project pre-rendered alpha textures made in Maya on Substance Painter, but again I would ideally like to bake these for better accuracy. Any help is appreciated  The below picture is the xGen version just for reference sake.

Replies

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Bake them in Maya using Arnold
  • Manjiana
    Offline / Send Message
    Manjiana polycounter lvl 3
    One thing to consider is when it's too much noise or xgen hair is penetrating the base mesh - this can cause artifacts on baking.
    you are welcome to check my timelapse of the hair cap baking - not the lashes and brows - but the same workflow - maybe it could be helpful.
    https://youtu.be/_IU4DkEWTwI
    (sorry for the audio)



  • thomasp
    Offline / Send Message
    thomasp hero character
    Manjiana said:
    One thing to consider is when it's too much noise or xgen hair is penetrating the base mesh - this can cause artifacts on baking.
    you are welcome to check my timelapse of the hair cap baking - not the lashes and brows - but the same workflow - maybe it could be helpful.
    https://youtu.be/_IU4DkEWTwI
    (sorry for the audio)



    Nifty how you get the ID maps baked. Those were a big headache when I was doing it in Marmoset coming from Max. Seems a bit like a happy accident on account of Maya laying out the UVs in a specific way tho? Most particle systems would probably simply stack them in one square. Pray they don't ever alter that. ;)

    Just wondering if you have any way to create flow maps via Marmoset baking too? Those are pretty essential for haircaps IMO.

  • Manjiana
    Offline / Send Message
    Manjiana polycounter lvl 3
    For the ID map  - you can also "select random" (in Maya and Blender, I guess in Max can do that too) and place the UVs like that manually.

    For the flow map - imho, the best way is to draw it using Substance Painter https://docs.substance3d.com/spdoc/flow-map-painting-143327274.html

    There's also a great tool for creating lashes/brows from Olivier Lau HairTG - Surface, Facial Hair Edition - this one is free, for hair caps I believe he sells another version.

    Anyway, it's a procedural tool, creates all the maps you would need, flow map as well - and he uses this SP flow map painting method.
  • thomasp
    Offline / Send Message
    thomasp hero character
    Nah it's fine I'm all set in Blender, able to bake all of that straight from curves/particles in one go, no conversions or export needed.

    Just curious how you would handle it in Maya since I sometimes peek over the fence. Painting flow in SP - did that a long while ago. Not great to having to do it manually and not viable if you have a lot of overlapping strands or afro curls etc. If you smear over those the result will actually fight the baked details in the shader. Also if you touch up the hair texture manually you better be sure that the UV layout does not need changing.

    Mine do, all the time. :)


  • ChristheLancer97
    Offline / Send Message
    ChristheLancer97 polycounter lvl 4
    @Manjiana thank you for this info! I'll give it a full watch very soon :)

  • Neox
    Offline / Send Message
    Neox godlike master sticky
    thomasp said:
    Nah it's fine I'm all set in Blender, able to bake all of that straight from curves/particles in one go, no conversions or export needed.

    Just curious how you would handle it in Maya since I sometimes peek over the fence. Painting flow in SP - did that a long while ago. Not great to having to do it manually and not viable if you have a lot of overlapping strands or afro curls etc. If you smear over those the result will actually fight the baked details in the shader. Also if you touch up the hair texture manually you better be sure that the UV layout does not need changing.

    Mine do, all the time. :)



     so how do you do the flowmap? can you bake it straight in blender?
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Wrt the Maya question.  Arnold allows baking of direction per strand from xgen hairs (dpdv/dpdu or something)  which is dead easy to make use of in a shader 
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    poopipe said:
    Wrt the Maya question.  Arnold allows baking of direction per strand from xgen hairs (dpdv/dpdu or something)  which is dead easy to make use of in a shader 

    does this also work on something thats not just a plane? say i have a creature full of hair, how good are those bakes?
  • thomasp
    Offline / Send Message
    thomasp hero character
    Neox said:

     so how do you do the flowmap? can you bake it straight in blender?
    Yes, I'm baking everything with the bake scene template that the Hairtool addon ships with.
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    thomasp said:
    Neox said:

     so how do you do the flowmap? can you bake it straight in blender?
    Yes, I'm baking everything with the bake scene template that the Hairtool addon ships with.

    need to test that, xgen/maya sucks big time
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    thomasp said:
    Neox said:

     so how do you do the flowmap? can you bake it straight in blender?
    Yes, I'm baking everything with the bake scene template that the Hairtool addon ships with.

    ah this is a for haircards workflow. still interesting but i also need a body full of actual groomed hair to bake down as a base (and lowest LOD). so far i never really had luck with haircards baked down
  • thomasp
    Offline / Send Message
    thomasp hero character
    Neox said:

    ah this is a for haircards workflow. still interesting but i also need a body full of actual groomed hair to bake down as a base (and lowest LOD). so far i never really had luck with haircards baked down
    You can use the same workflow but the groom has to be flattened to UV space. I think there are some examples on how to do it in the Hairtool docs. I found it has its pitfalls though - accuracy is the issue when flattening the groom, for a full creature visible UV seams might be another.

    If you can live without a baked flowmap then baking geometry in Marmoset or Blender can be an option: https://polycount.com/discussion/224503/baking-groom-onto-geometry-problem#latest

  • Neox
    Offline / Send Message
    Neox godlike master sticky
    thomasp said:
    Neox said:

    ah this is a for haircards workflow. still interesting but i also need a body full of actual groomed hair to bake down as a base (and lowest LOD). so far i never really had luck with haircards baked down
    You can use the same workflow but the groom has to be flattened to UV space. I think there are some examples on how to do it in the Hairtool docs. I found it has its pitfalls though - accuracy is the issue when flattening the groom, for a full creature visible UV seams might be another.

    If you can live without a baked flowmap then baking geometry in Marmoset or Blender can be an option: https://polycount.com/discussion/224503/baking-groom-onto-geometry-problem#latest


    thanks! this is pretty much where i am at right now as well, flowmap is also not a problem just add the normal down green to the normalmap of the fur mesh and flowmap is baked.

  • Neox
    Offline / Send Message
    Neox godlike master sticky

    so while i can bake normalmaps for the xgen hair i found those maps to be highly lacking or not look nice as they kinda are the same as the mesh underneath just slightly off. instead what i wanted is for them to be slightly randomized. this is where the convert to geometry with UV comes into play. basically all you need is a 3x3 pixel texture with a random normalmap value per pixel. this you plug into the albedo of your hair, bake it out and apply in substance painter as its own layer, here you can now tweak how random you want the individual hairs to be.


    seams are an issue (usually not for lashes or eyebrows) but if you do random  objectspace normals you can convert those into tangentspace, then the result is pretty much seamless

    if you apply a normalmap downvector 128,255,128 to the normalmap of your groom/highpoly you will also be able to bake a flowmap which imho is one of the most important map for the look/shading of hair

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    Neox said:
    poopipe said:
    Wrt the Maya question.  Arnold allows baking of direction per strand from xgen hairs (dpdv/dpdu or something)  which is dead easy to make use of in a shader 

    does this also work on something thats not just a plane? say i have a creature full of hair, how good are those bakes?
    its down to how much resolution you've got / AA settings etc. really - Don't recall there being an issue at seams but it's been a at least 2-3 years since I last looked at it

    arguably you could get much the same information out using your flowmap + a root to tip gradient, just a question of how may things you want to bake i guess
  • thomasp
    Offline / Send Message
    thomasp hero character
    Neox said:
    if you apply a normalmap downvector 128,255,128 to the normalmap of your groom/highpoly you will also be able to bake a flowmap which imho is one of the most important map for the look/shading of hair

    Sounds intriguing but would you care to elaborate how do you apply this normalmap and what channel do you bake in to get to this endresult? Is this baker- or xgen-specific?
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    this is just in toolbag, but it is xgen specific thanks to the way that xgen conversion to mesh applies UVs. which i also use for random normals or IDs

    i apply the downvector as a normal to the hair geometry (much like you would just use the green for your downfacing haircards) and bake this into the normalmap of the lowpoly, this is the result. is it the wrong math?
    maybe, i am not technically versed enough to know. I just thought, hey the cheap flow for haircards is the normal down vector, lets try!

    It worked, the shading looks correct on the asset and its seamless, well within the boundaries of texture resolution and texel density, but what isnt?
  • thomasp
    Offline / Send Message
    thomasp hero character
    Neox said:
    this is just in toolbag, but it is xgen specific thanks to the way that xgen conversion to mesh applies UVs. which i also use for random normals or IDs

    i apply the downvector as a normal to the hair geometry (much like you would just use the green for your downfacing haircards) and bake this into the normalmap of the lowpoly, this is the result. is it the wrong math?
    maybe, i am not technically versed enough to know. I just thought, hey the cheap flow for haircards is the normal down vector, lets try!

    It worked, the shading looks correct on the asset and its seamless, well within the boundaries of texture resolution and texel density, but what isnt?

    Oh I just didn't follow in terms of what to do where. :)

    Have to admit it never occurred to me to apply a normal to the high poly's material and bake that end result down onto a normal map for the lowpoly. Interesting!

    Will have to verify with overlayed hair cards to see how well it matches up but so far my result looks correct (adapted for Blender's groom UV output). Nifty trick! Should come in handy.
    Thank you!

  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth

    Sorry for the thread necromancy. Just tried this out myself and it seems to work beautifully. @Neox - Great trick man, thanks for posting it. Should also work for Zbrush Fibermesh hair if you've remembered to assign UVs to it ( doesn't happen by default).

    Just a quick sanity check - I assigned the 128, 255, 128 map as a tangent-space normal to the highpoly, baked that to the lowpoly tangent space normal then renamed it as a direction map and assigned it to the right slot. Did the rest of the bakes as usual after turning off the down vector map on the highpoly. It looks right, but just wanted to see if that's the correct process.

    Crappy test hair cap here :


  • Neox
    Offline / Send Message
    Neox godlike master sticky

    looks good to me

    is it accurate? what do i know :D haha


    so my thoughtprocess was, hey the cheapo way of flowmaps is, uvmapping the strands straight, top to bottom and apply the green map / down vector, why should this not work for the individual hairs if mapped this way?

  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth

    Did a quick test in Fibershop using the hand draw mode and roughly drew out a similar pattern as my hair cap above. Flow map looked pretty much the same, so I'm calling this a win unless some mathematician turns up and tells us it's all wrong :D

Sign In or Register to comment.