Home Technical Talk

Hair Unreal 4 - Issues

polycounter lvl 6
Offline / Send Message
Kyoske polycounter lvl 6
Putting out a request for some help from the community.

So I have been unable to find a good solution for hair in unreal 4. Largely because from my limited understanding in unreal they use a deferred Rendering setup vs forward rendering.

So using an opacity mask gives me no fall off everything looks chunky for hair (looks like foliage cut out grass). And if I use translucent settings I get a good fall off but no lighting or self shadowing works so the hair lights up like a Christmas tree. I tried over lapping Both and the lit up translucent one takes over.

Does any one know of or have a work flow for hair. I have gone through the Varga tuts and all the hair building stuff under the sun and that all looks fine in Maya but the second it hits UE4 it looks like trash.

Thanks every one for putting up with my wall of text but this has been an issue plaguing me for weeks. And I'm at my wits end.

Example:

http://gamedevelopment.tutsplus.com/articles/forward-rendering-vs-deferred-rendering--gamedev-12342

Replies

  • Der Hollander
    Options
    Offline / Send Message
    UE4's lack of forward rendering is a huge pain for stuff like hair, but on the other hand they re-implemented dithered transparency. A while back I did a project in UE4 with a character that had hair, and from what I can tell, this area is essentially the Wild West as far as UE4 is concerned.

    I think they put Dithered Transparency in as a node in the material editor buried deep somewhere (I can't find it in the Documentation but I know its in there somewhere), but also check in the transparency material settings. I would try giving that a go, it's not a perfect solution but with a decent-res alpha mask and some jiggery-pokery you might be able to make something servicable. I dunno if you'd be able to combine that with a SoftOpacity node or not, but that might also help.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    I will give it a Look. I'm just over joyed you respond with some relevant info!!!!

    Hair seems to be something every one ignores.
  • Der Hollander
    Options
    Offline / Send Message
    I was still racking my brain on how to go about it, so when I got home I cobbled together a quick material using some junky old models and textures I had laying around:
    e423da6001b4c99311317827e9beb71e.jpg
    4bd5c4924fcadaa3495b8847cfb034ff.jpg

    It's by no means a perfect way of achieving hair transparency, but it's got some good points to it. Since it's 1-bit transparency, it doesn't suffer from the problems with 8-bit alphas such as sorting order and not playing nice with environment fog/particles. On the other side of the coin, this material gets really instruction heavy, really fast, so I don't know how practical it is.
    It's entirely possible that you might be able to drop the BlurSampleOffsets node entirely and let FXAA blend the pixels for you, but I'm not entirely sure how to go about that, Post-Processing is a bit out of my wheelhouse for the moment.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    Hell ya in the right direction! We had one of the guys from unreal come into work and give us a kinda of work around. How they did the hair in the infiltrator demo. Sadly I was not at the office when he was there. I think they recorded it and I will try and dig that up and see if we can keep making head way on this.

    I really want to know how they did the fur in the hell blade video. Because from my understanding its all in UE4


    Now maybe its because I'm using crap textures and geo I generated in 10 minutes but I'm getting a strange fuzzy result. I must say yours is much cleaner.

    Pardon my slow learning and material understanding, I literally started working in Unreal 4 on Monday.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    But really thank you for helping with this! you are quite literally the only person who has said one word to me in response to this issue.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    So after combining a few foliage setups and your dithering process. I found the video from the UE4 guys and its pretty much forcing dither. They pretty much take a noise image and run a panner node on it to animated the noise and fade the edge. I couldn't get a result that looked better then the dither.

    last thing I have to test is how this turns out when it comes to animation and live dynamically lit scene.

    This is what I was able to come up with and get a pretty good result.

    Well I should say the best controlled result I could come up with. Let me know what you think. And if you see any improvements/changes we could make. Once this turns into a half way decent temp solution I want to share it on UDN/UGN and openly in poly count.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    I built it under the guise of using MI to control the material because I will be using this for folks at the office. I would prefer they don't muddle around in my Master.
  • Froyok
    Options
    Offline / Send Message
    Froyok greentooth
    One of my character doesn't have yet his hair geometry, but once I will have done that I will try that solution and write a feedback. The dithering is an interesting idea.
  • JordanN
    Options
    Offline / Send Message
    JordanN interpolator
    Epic showed how they made the hair in the Samaritan Demo
    http://www.nvidia.com/content/PDF/GDC2011/Epic.pdf
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    Ya they talk about the process but that does not work in UE4.

    Largely because UE4 is s Differred rendering.

    I'm finalizing the node network so it can be instanced properly. then I will pose each layout and its connections.

    As always if any one has some good feedback or solutions let me know.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
  • Der Hollander
    Options
    Offline / Send Message
    No chance you could upload a stitched-together image of the material? I'd like to check it out and see how it works here in a few days when I've got some time.

    The process for the Samaritan demo would work in theory in UE4 since they stuffed deferred lighting into that demo and used 1-bit alpha, but those slides explain bugger all about what steps they took. The most helpful slide in there is the one about camera-oriented planes, but that only works for short hair :/
  • Ssjtroll
    Options
    Offline / Send Message
    Ssjtroll polycounter lvl 8
    Hey, I grabbed a screen shot of the whole material. I have been working with Kyoske to do some trial and error with the hair shader.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    Thanks troll. I found a few more bread crumbs in regards to forcing UE4 to use some hybrid of forward rendering.

    I will see what I can dig up in the morning.
  • Abbeysaurus
    Options
    Offline / Send Message
    Abbeysaurus polycounter lvl 3
    Kyoske wrote: »
    Thanks troll. I found a few more bread crumbs in regards to forcing UE4 to use some hybrid of forward rendering.

    I will see what I can dig up in the morning.

    Hey, any updates on this thread? I've been trying to get some decent looking hair on my character too.
  • ixrob
    Options
    Offline / Send Message
    ixrob polycounter lvl 10
    same here, im interested.
  • Kyoske
    Options
    Offline / Send Message
    Kyoske polycounter lvl 6
    Yes.

    We will be building an updated ver and sharing it. Me and troll where able to create some pretty solid looking hair in UE4.

    Maybe in the next week or two.
  • jerry
    Options
    Offline / Send Message
    Hi,

    What is the point of the BlurSamplesOffset node in your graph? I'm pretty sure it does nothing.

    It implies it will do a blur but that node does not do any blurring.

    Also, any further updates?
  • Fisher007
    Options
    Offline / Send Message
    Fisher007 polycounter lvl 8
    Hi Kyoske,

    Are you still planning to post the results? Looked around everywhere and not a single half decent result made in UE4. It would be really great to see what you guys got. :)

    Thanks,
    Fisher
  • claydough
    Options
    Offline / Send Message
    claydough polycounter lvl 10
    haven't tried the following myself but the two sided foliage shading model, compatible with engine versions 4.7 and later looks like it might be helpful? Particularly the settings in the Opacity mask

    NewVsOld.PNG


    from the "UE3_to_UE4_Transition_Guide":
    Materials
    "Soft Edge" for Particles and Translucent Materials ( like hair I spose... a translucent material with a soft edge? )
    UE3:
    Attach the opacity mask to Alpha input of DepthBiasedAlpha and set Bias scale for fade distance.
    UE4: Attach the opacity mask to Opacity input of DepthFade and set Fade Distance.

    https://wiki.unrealengine.com/Two-Sided_Foliage_Material
    https://wiki.unrealengine.com/UE3_to_UE4_Transition_Guide

    Also,
    Ehamloptiran 's solution looks interesting includes simulation ( been progressing on the unreal forums, don't know if performance is realistically possible? Or when the pug-in will be available )
    https://forums.unrealengine.com/showthread.php?6855-Hair-Rendering-Simulation-test
Sign In or Register to comment.