Home Unreal Engine

DX 11, Hair? Questions...

So me and well the rest of my class are trying to figure out how to do create realistic hair in UDK using DX 11 as shown in The Samaritan [ame="http://www.youtube.com/watch?v=RSXyztq_0uM"]Here[/ame]. Now I've tried researching as much as I can, and I can't seem to find anything pertaining to this workflow of using MSAA etc. I've found some other Documentation Here (Slide 9) where they show a little bit of the material tree, but I don't quite understand what's going down in it. And I've found and downloaded Nvidia's Hair DX 11 Demo [ame="http://www.youtube.com/watch?v=jO0XARYk2TM"](here is video)[/ame], but that doesn't help with much of anything except for look pretty. So does anyone have any idea of how to go about making this material or can help explain some of what I've already got? Thanks in advance for the look and help!

Replies

  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    those two videos show entirely different techniques, and i'd go so far as to say that the one used in the samaritan video will only work for shorter hairstyles.
  • R0gu3
    I'm aware, I was just presenting the examples I had. I'm curious about how to create this for use in UDK, (which is shown in Samaritan). They show some of the process in the PDF I linked, but I don't understand exactly what is going on...
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    the workflow seems to baaaasically follow the following:
    • create 128*256 texture with ~20 hair strands painted on
    • make spline based hair in hairfarm (expensive plugin)
    • do splines to triangles in hairfarm (haven't found anything else that can do the same thing)
    • use the vertex shader in udk which spreads the hair triangles verts apart into traditional hair cards, and uses the pre created hair texture.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    They're still using the traditional Alpha setup with Plane, only that they're using the flat planes being generated by the plugin Hair-Farm as the basics for the kludge work.

    The material is then fattening the spline based plane and applying the Alphas Gir mentioned.

    It's too much work for what you want honestly, just use standard hairs with Alpha created manually, and have them setup with a Physics materials which (I guess again, through Vertex colors) 'moves' the extremities of the hair.

    Also, you most likely need to setup also your own custom shaders for the 'looks' of the hair, which will add to the work. Since I'm not seeing anyything premade.
  • R0gu3
    Ah thank you both so much, Is their a Hair farm plug in for Maya perchance that you know of? Everything else you said makes sense and I really appreciate the info!
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    No idea mate, sorry, but I remember people praising Maya's particles/physics/procedural/etc creations tools, so maybe their hair and fur solution is already good?

    Max's hair and fur is pretty dry and cut, so that might explain the reason they need such an expensive plugin for something so simple, but which requires grind work.
  • R0gu3
    Well on that note, do you know of any decent tutorials for the worklow, or even just how to build the hair in the Mat editor?
  • almighty_gir
    Offline / Send Message
    almighty_gir ngon master
    apex works well for long hair btw, the only problem you'll have is that you MUST use alpha test instead of alpha blend, otherwise you get sorting issues all over the place.
  • R0gu3
    Apex, Like apex cloth? I don't know if I quite understand what you are saying- is Alpha Blend/test a UDK setting?
  • R0gu3
    So I've been thinking and looking up stuff etc, and are you suggesting that I take my planes that will be scattered about like hair and rig those with Apex cloth?- If So do I just make my plane and Texture really long and skinny? How would that go aout for single strands or at least the effect of Single strands kind of like here, (and this is using UDK)

    [ame="http://www.youtube.com/watch?v=WpW6kPBnyQ4"]http://www.youtube.com/watch?v=WpW6kPBnyQ4[/ame]]
  • Money
    Offline / Send Message
    Money polycounter lvl 8
    Alice hair was actually custom tech. Link below is a document where they explain how they did it.
    So, one last question -- kind of a weird one: We noticed that it seemed like extra special care
    had been taken to animate Alice's hair. What's going on there?


    It's not animated. It's all dynamic -- it's real-time. It's quite a feat of technology. There's a guy on our team named Milo Yip, who is from Hong Kong; really, really good at this kind of physics and material technology. So he went in there and built this entire system for cloth and hair in the game, which we think is actually really special.
    http://translate.googleusercontent.com/translate_c?act=url&hl=en&ie=UTF8&prev=_t&rurl=translate.google.com&sl=zh-CN&tl=en&u=http://www.cnblogs.com/miloyip/archive/2011/06/14/alice_madness_returns_hair.html&usg=ALkJrhhCqAxFdxyoMVtBAgzrys9eerh9iQ
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 18
    There are a ton of ways to build hair, material wise and geo wise.

    Most of the good looking geo solutions are a bunch of alpha cards or strips, arranged to create layers and give the impression of volume.

    Material solutions vary from just plain old diffuse color and alpha to fibre simulations.

    For hair of any real length the highlighting is extremely important to selling it. You can often get away with a fairly standard anisotropic blinn/phong specular model and a nicely done normal map. Don't put too much emphasis on individual strands, but do model the larger flow of the hair into the maps. (if you go that route)

    also this:
    http://wiki.polycount.com/HairTechnique?action=show&redirect=Hair+Techniques
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
    http://www.nvidia.com/content/PDF/GDC2011/Epic.pdf

    This outlines the method Martin Mittring and myself came up with for creating the hair in Samaritan. It doesn't cover the shading but I used custom lighting with my own lighting model similar to kajiya-kay.


    Just realized you posted this in the first post. The jist was create hair using hair farm. Convert to splines. Loft a very thin polygon along each spline and generate Uvs. Create shader in ue3 that widens the thin polygon perpendicular to the camera.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    ^
    Couldn't find Marschner hair shading setup ;P
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
    Actually read both and in the end created my own that took them into account but had tweaks for ue3 rendering and worked better in our scene.
  • R0gu3
    @Money, Oh Cool didn't know that, wouldn't making the segements of hair and using Apex cloth make it dynamic?

    @Vailias, Thanks, But we're trying to figure out the DX11 workflow and how to implement that kind of setup

    @JordanW, Wow thanks for the breakdown, you worked on this project? And If I understand, you made a few Hair strands using a plugin. then converted those to their own Line? (i'm just getting confused sorry), and then Loft, okay, now I really start getting confused lol, Make your standard hair texture with alpha etc, and then use the shader that you created in udk (displayed in the pdf?)

    I'm sure there's a lot going on would there be anyway you could make a brief tutorial? Just trying to get to the point to where I can do a Demo for class
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    JordanW wrote: »
    Actually read both and in the end created my own that took them into account but had tweaks for ue3 rendering and worked better in our scene.

    Wow, wait, go back a second, you found a non-destructive document that showed M's formula? I know that Nalu has some HLSL you can figure out, but even they didn't give all the information such as what was needed in the Alpha of my texture lookups and the paper itself has a few mistakes (not really noticeable, but makes the whole world of difference in some places)!

    Mind showing me a link? Unless, ofcourse, you're not allowed to.
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Thanks, doesn't have the real formula, but it should help me reverse the formula from using Kay as a base.

    Cheers!
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    Ornatrix does this really well for 3DS Max.

    I will write up a tutorial for this, but the bangs were made by hand using just planes and looking at photo reference, but the back of the hair was all created using Ornatrix, and converting to billboards (with UV mapping already). You can specify how many divisions along the length, whether they should be flat, or cylinders (and how many sided cylinders). The combing and styling tools are easy to use. The only thing I don't like is that if you change the number of hairs after styling, you lose the style and have to do it again.

    Keep in mind I'm not done editing the ornatrix hair, just posting this as a quick example. I have collapsed it to a mesh and am now custom editing it for finer control.

    mesh_hair01.jpg
  • R0gu3
    Well I think I understand the creation part for Maya, however it's the transition to UDK that's confusing me right now. (that and my photoshop won't save Targa for some reason) And Jordan take a look at my prior post?
  • JordanW
  • Millah
    Offline / Send Message
    Millah polycounter lvl 18
    Hey Ben,
    Hope all is well. How does Ornatrix go about converting to billboards? I don't have a copy of it(Ornatrix) at this time, but am using HairFarm for some hair tests right now and I'm trying to find good solutions for converting to billboards. Was wondering if the process you are going through is unique to Ornatrix, or if it's something more generic I can just use with HairFarm.

    Thanks,
    Justin


    Ornatrix does this really well for 3DS Max.
    but the back of the hair was all created using Ornatrix, and converting to billboards (with UV mapping already). You can specify how many divisions along the length, whether they should be flat, or cylinders (and how many sided cylinders). The combing and styling tools are easy to use. The only thing I don't like is that if you change the number of hairs after styling, you lose the style and have to do it again.

    Keep in mind I'm not done editing the ornatrix hair, just posting this as a quick example. I have collapsed it to a mesh and am now custom editing it for finer control.

    mesh_hair01.jpg
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    It's an ornatrix modifier called "convert strands to mesh" or "create mesh from strands" I forget right now. You can choose between cylindrical, and how many sides, billboard that always faces camera, or billboard oriented to strand direction (which is what I chose). You set the divisions from base to tip in the original modifier creating the hair. It's all quite easy actually, and I plan to make a video tutorial sometime next week, but my schedule is full right now.
  • R0gu3
    Hey, I'd be interested to see that video if you'd post it here I'd appreciate it
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
  • R0gu3
    Thank you for the vid but I'm not getting any audio?
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    There isn't any. I had workers building stuff in my house and my dog was barking ever 3 seconds. I tried to make it clear what I was doing through only the mouse and timing, but if you have questions, let me know and I can clarify.
  • BishyT
    I've been trying to do this myself. I used Zbrush fibremesh to generate the hair, converting the final mesh into splines using a freebie script I found on the internet. I then converted these splines into very thin polygonal strips (as described in the Samaritan presentation), imported into UDK, and then tried by best to recreate the vertex shader based on the one blurry image we had. I even went a bit overboard and attempted to try it out on his facial hair too.

    Phjysl.png

    I managed to get the basic effect down. It's not perfect, but i'm quite proud of it. I think the main thing that lets it down is actually the skin texture, which lacks any painted hair, thus giving the appearance of bald spots.
  • R0gu3
    Hmm, that's really interesting Bishy, it looks like it's almost there
  • StaticTheFox
    I sort of understand how the geometry for Samaritan's hair works, but what about the coloring? Was it done all in the material editor?

    Also, would it be possible to rig the polygons to Apex Cloth for long hair?
Sign In or Register to comment.