Home Technical Talk

hair techniques

Ruz
polycount lvl 666
Offline / Send Message
Ruz polycount lvl 666
just wonndered if anyone had a definitive hair technique.
For short hair cuts i go for the spiky flat top look with lots of alpha 'fan' shapes
For female long hair i have been trying a kind of hair helmet and also tried lots of 'leaves' of hair, raidiating from the crown.
The problems lie with intersection of the leaves, making it look a bit less convincing.
It can easily end up looking like a cheap toupee

I made my hair using surfce tools in max, so i could go back and tweak the shapes easily at spline level.
Anyway, it would be nice to hear some thoughts on hair techniques.

Just to make it clear I am not really stuck on this, just exploring the various options really

Replies

  • Steve Schulze
    Options
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    Poop in my Mouth hand something or other a while back...

    Here...
    http://www.poopinmymouth.com/process/hair_tutorial/hair_01.htm
    Looks like its mostly about texturing, but the examples page might give you some ideas if the actual tutorial isn't what you're after.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    i use polyplanes, roughly shaped like the desired haircut and layer them. since they are irregularly shaped, i usually have to uv them individually and later in the process create a few copies, mirror and tweak those to create more volume.
    for long hair i model a guidemesh and use clothsim to shape the planes as desired.
    i try to avoid intersecting planes as much as possible. also, having "leaves" sticking out of solid geometry doesn't look convincing for me, so i try to at least hide the seams, snap to edge, face and vertex helps alot in this.
    also what i found looks rather horrible is to re-use the same texture snippet and polyplane all the time.

    of course, it all depends on what kind of polycount you're working with.

    example-pic
  • Josh_Singh
    Options
    Offline / Send Message
    Josh_Singh polycounter lvl 18
    Zombie Einstien has some great hair.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    some good suggestions there guys
    yeah as i say its not really about me being stuck here. I have done some pretty decent hair, but I wanted to start a bit of a discussion on this.

    I am favouring the modelled hair approach right now, ie geometry to roughly shape the hairstyle and then a few alpha wisps.
    Also i will be looking at shaders to get a nice realistic hair texture.

    For all I know we might end up developing a hair technique at work so all this will be in vain.
    I am thinking along the lines of the mermaid hair in the nvidia demo, which looks pretty nice.

    i wonder is this sort of approach will be practical in next gen stuff or will be generally too expensive.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    shaders as in pixel shader fur techniques? right now, everything i've seen looks goofy and there's always the problem of how to control the haircut. even in rendering tools like shag it's a pain to create a hairstyle. but with technological advancements it might become useful one day.

    the drawback with alpha mapped planes is the depth sorting issue, especially when several different alphamapped objects overlap. but in some engines is worse enough with only a few layers of alphamas in the scene.

    animation-wise the alpha-mapped approach requires a bit more work but produces as very controllable result. in previous tests i've used clothsim to drive bonechains which the hair was constrained to. works well for baking out skeletal animation minus a few issues with animation blending.

    the question is if it's cheaper to create hair and animate it via pixelshader or use alpha-mapped geometry that's skinned to bones. seems to me that gfx cards these days have a lot of improvements on the pixel-shader side of things but lack raw poly-pushing performance increases.

    anyway, interesting topic.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    yea the depth sorting issue is a real pain.
    I suppose there should be some way of labelling each alpha plane, so they are sorted correctly.
    Yeah i think no matter how good the shader/technique is, the hairstlye never looks quite natural.

    I often think I have done a great technique then it falls down at some point.

    hmm so could I make a hair helmet and use reactor to make it fall naturally on to the head?
    I have not really used reactor much, so am not sure how far you can go with this.
    I am not too conderned about the animation of the hair at the moment, just getting a nice static hairstyle that hangs naturally would be cool
  • Isis' Minion
    Options
    Offline / Send Message
    Isis' Minion polycounter lvl 18
    Dead or Alive 4 seems to be using hair made out of actual mesh:
    http://media.www.gamestats.com/media/545/545798/img_2970601.html

    They use it along with the physics engine and it looks quite nice imo.

    It would be cool if they'd make a engine that supports hair like you often see in CG movies (like Final Fantasy), but i think that that stuff might be a bit too expensive. A friend of mine said that Aki's hair was 15000 polys, though, i dont know if this is trustworthy data, but if it is, that is way too much for current PCs even, i think (imagine having 5-10 of those characters on screen laugh.gif ).

    I agree, the hair on Einstein looks very nice, but it's very tedious to make, imo. I might have a take a shot at it soon, myself, as well.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    final fantasy hair was made from curves (renderman primitive). the approach is very similar to what e.g. shag hair uses but probably they had better controls and didn't have to fight against that performance eating memory hog. of course their solution was never released (unlike their clothsim which is now marketed as syflex) but apparently square continues to use it (advent children, ffx cutscenes).

    btw. there was a realtime ff demo out there when quadro was introduced. they converted the hair to polygons for an nvidia demo so maybe your friend is right.

    well, einstein's hair is really a rather extreme example, "normal" hairstyles are far easier/faster to achieve. i have a pile of those but since the game they were created for is not yet released, i don't fell secure posting them.

    sorting alphaplanes manually: done that once, it's only of use for characters which can only been viewed from a certain camera angle. for anything else, the sorting order is incorrect again.

    clothsim: what i do is create a mesh that serves as a ground plane and then "sim" planes over it, create offsets and achieve a rather nice non-intersecting bunch of layered planes. i do not use reactor, totally dislike it's "usability". simcloth gives me better feedback and is ok for those simple tasks. max 7.5 and up apparently comes with clothfx.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    I gave reactor a try, but didn't have much joy with it

    Its a shame that syflex doesn't come for 3dsmax
  • Kraftwerk
    Options
    Offline / Send Message
    Kraftwerk polycounter lvl 19
    Yes interisting topic indeed and these typical sorting problems
    are on PC 3d engines, consoles however had never these problems.
    In Elder Scrolls: Oblivion they seem to solve this with an CG
    Shader the hair on the screenshoots looks nice a thing i like
    to know is how the next Unreal Engine solve this or if the
    engine solve this, the engine version of UT2004 does an bad
    job on this...
  • Steve Schulze
    Options
    Offline / Send Message
    Steve Schulze polycounter lvl 18
    [ QUOTE ]
    It would be cool if they'd make a engine that supports hair like you often see in CG movies (like Final Fantasy), but i think that that stuff might be a bit too expensive. A friend of mine said that Aki's hair was 15000 polys, though, i dont know if this is trustworthy data, but if it is, that is way too much for current PCs even, i think (imagine having 5-10 of those characters on screen ).

    [/ QUOTE ]I seem to remember rumours coming out around when the movie was released that the hair took longer than anything else in the movie to render. While that was evidently a hideously inefficient algorhythm, I think we're a long, long way from ever getting anything even slightly like that to render in real time for games.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    well, they stated that they used up to 60k riCurves for generating akis hair, depending on how close she was to the camera. that amount in animation sure took an eternity to calculate for every frame. still, most of it was probably press hype, after all magazines need this kind of spectacular stuff to write about. i guess akis hair was faked to speed up rendering wherever possible.

    ruz: i agree, using reactor feels like shooting yourself in the foot - 25 times per second. as i wrote, i use simcloth, which has a realtime preview in the viewport and is quick to set up. you have to grab it from the usual sites though, it's a non-supported freebie these days.

    kraftwerk: any technical reasons for consoles to be better at alpha sorting? i can attest that there are sorting problems in metal gear solid and ffx on the ps2, however you have to look out for them since they are few and far between. unreal engine 2 on pc was really nasty at sorting hairplanes, true.

    edit: just had a look at this nvidia mermaid demo. the hair is impressive in motion, true. but it's just long, floating hair - they sure didn't have to style a certain haircut, that's where (for me) the problem lies with the "furry" or spline based approaches. only polys give me the neccessary control.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    thomasp , can you post an example of your hair technique or it all under NDA.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    ruz, what kind of examples do you mean, pictures/animations of finished work? most of my stuff is under nda, though.
  • Ruz
    Options
    Offline / Send Message
    Ruz polycount lvl 666
    yeah just the basic shapes you used. i have quite bit of succes with the hair so far, but I didn't do a very good style. its looks a bit 80's and I made a mess of the fringe

    I would love to show it too, but its nda also.grrr
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    just wondered what everybody and their dog thinks about snake's hair from the mgs4 trailer:
    mgs4_solid_hair.jpg

    to me that looks like a blend of common alpha mapped polygones and some custom developed stuff that's used to mix in strands of hair. like it can be seen on his moustache and the hair in the neck area. tasty!
  • Ramucho
    Options
    Offline / Send Message
    Ramucho polycounter lvl 18
    anyone saw advent children hair? still don't know if they use alpha maps or not... they have some awesome hairstyles there.
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    i still think FFXII has the best realtime hair i have ever seen.. http://www.fantasy-forever.com/FF12.php?page=FFXII.SS.html
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    advent children: doubt it. they sit on a pile of technology developed originally for spirits within, they probably use this stuff or an improved version of it. poly planes in motion generate nasty clipping and not the best kind of dynamics, for an extreme close up in a film, that's not enough (imho).
  • Darksun
    Options
    Offline / Send Message
    Darksun polycounter lvl 18
    XII looks very nice, but I think MGS4 is a step up. I like the hair style of XII more tho.
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    the back of that dudes hair in MGS4 looks really cool.. but the top looks like total crap.. like someone took the top of a sphere and just used the smudge tool a bunch until it became a blurry mess..and his mustashe looks like its one of those fake ones that comes with a nose and glasses attached..imo the hair is the weakest part of his whole design.. the back is pretty nice.. but the top and stash really dont match the quality..
  • motives
    Options
    Offline / Send Message
    motives polycounter lvl 18
    i think the msg4 hair got design issues.. i mean wtf blonde moustache? he looks like rudi völler
  • Daz
    Options
    Offline / Send Message
    Daz polycounter lvl 18
    I don't understand why we aren't making a clear distinction in this thread between pre-rendered and realtime hair? Two very, very different things.

    There is really only one way to make hair for realtime ( and yes, that includes next gen consoles ) , and that's alpha'd poly strips.
    Hair that's pre-rendered is generally procedural curves using a plug-in such as Shag or Shave, or a a proprietary tool. Personally I like Shave because of the awesome styling UI. Ironically I've recently made some geometry hair that was destined for pre-rendering because the procedural hair was taking too long to render and we just didn't have the time. In that instance I used a bunch of alpha'd poly strips with an anisotropic shader. Worked a treat actually.
  • Ramucho
    Options
    Offline / Send Message
    Ramucho polycounter lvl 18
    cuz we're the n00bs :]

    Actually the fact cloud's hair were confusing me, so I thought what if they had used some alpha maps with an uber high resolution and a anti-aliasing technique (like the anisotropic shader you were talking about).
    Thanks for the info tho' may turn useful!
  • Toomas
    Options
    Offline / Send Message
    Toomas polycounter lvl 18
    [ QUOTE ]
    advent children: doubt it. they sit on a pile of technology developed originally for spirits within, they probably use this stuff or an improved version of it. poly planes in motion generate nasty clipping and not the best kind of dynamics, for an extreme close up in a film, that's not enough (imho).

    [/ QUOTE ]

    I think they used alpha, because its faster to render and you get rid of clipping when you clothsim the hair.
  • Eric Chadwick
    Options
    Offline / Send Message
    AFAIK, only the Dreamcast allowed perfect sorting of soft alphas, since it used the PowerVR chipset. Nvidia/ATI/etc. chips don't sort the same way, so we're stuck with bad sorting unless we use alpha-test (hard-edges). Someone please prove me wrong here!

    thomasp... how are you sorting Einstein's hair? I'd guess your shot is a prerender, not realtime? Manual sorting is a pain in the arse... basically sorting by vertex number right? (lower verts drawn first, etc.). That's the way I've done it, though for simpler things than hair.
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    eric: yes, that's a render from within max. however as far as the sorting goes, i've actually worked with technology that was sorting-friendly yet still ran on a standard pc ati or nvidia gfx. i created a bunch of equally complex hairdo's for realtime display that had almost no sorting issues. so it does seem to depend on more than just the gfx card/driver.
    i'd love to post pictures but these damn nda's... wink.gif

    sorting hair per hand is impossible imho. it wouldn't look right from different angles. done it once for a model that had to look right from only very few angles and was running in some totally stoneage engine, will never do it again - brrr...! smile.gif

    daz: why should we separate pre-rendered and realtime hair in this thread? both techniques seem very useful for pre-rendered stuff and to me it seems they mixed it in mgs for realtime as well.

    toomas: but will the hair motion be as smooth as with a spline based approach? after all you're simming planes, not strands, entirely different shapes. faster to render - i guess that depends. as soon as you're using a whole lot of planes, it get's pretty slow as well, also, at least for me there always was the issue of unrealistic shadow casting with planes.

    the main thing i dislike so far with spline based tools is how crude the hairstyling process works. am curious to finally try out shave as soon as max 8 finally arrives.
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    i dont know if i can prove you wrong.. but you can work around sorting issues with mulitple draw culls.. i know this is how some companies approach it.. i was just disscussing it last week with a friend.. we were talking about tools.. he was telling me that at his work its built into the export plugins.. they number the layers of hair planes in the order that they will sort.. when exported into the engine all is sorted nice with soft alpha blend.. and there is also that quite lengthy paper ati wrote on hair shaders.. but i am not sure if that will work on nvida cards..

    @thomasp..dont wait for shave.. get ornatrix the syling interface is lightyears beyond shaves.. we has subscription at mythic and i played with a bit.. and i see how when it came out how shave could of been considered a breakthrough but it really seems akward once you have syled with ox that plugin is magic.. and it renders a million times faster than shave..
  • Eric Chadwick
    Options
    Offline / Send Message
    [ QUOTE ]
    ... work around sorting issues with mulitple draw culls ... they number the layers of hair planes in the order that they will sort ...

    [/ QUOTE ]
    Thanks arshlevon. Yeah, this is the way we do it too. Usually we tell the exporter how many and which chunks of hair to divide the surface into. Then a particular vertex on each surface can be used as the sort position for it, so the surfaces are sorted back to front. Solves most problems, depending on how many surfaces we split the hair/grass/leaves/clouds/etc. into.

    But then we're dramatically increasing the number of surfaces that have to be transformed, which can be pretty slow if we have a lot of individual chunks of hair.

    I was hoping for some indication of another route, where I could send the hair to the vertex cache as a single chunk of verts.

    thomasp, thanks for sharing. I'm wondering if there's something in your pipeline that avoids multiple surfaces being tranformed separately, but still gives you decent sorting of soft alpha?
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    eric: that's not "my" pipeline anymore. i'm a freelancer, hopping from one project and company to the next. it's been quite some time since i worked on that engine. i can't tell you anything specific about it these days anymore, sorry.

    arshlevon: i've heard of that one, but isn't that most famous for it's crash-happyness? has it really become reliable?
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    yeah its super reliable..and has way more feature since the old beta days.. the guy did a complete rewrite of the code and then started selling it for only 150 bucks.. only problem is now digimation bought out the company and are going to release a hybrid of that and shag.. i dont know why ,ox does everything better.. you can download a demo of the current version here http://www.ephere.com/ornatrix/
    there are also tutorials on the site ,i really recommend checking out the eyebrow tutorial, the sinks are really cool and havent seen anything like them in any other hair system .... my favorite feature is the ability to save complete hairstyles.. even braids and parts.. eveything..and transfer those to ANY character.
  • Eric Chadwick
    Options
    Offline / Send Message
    Gotcha thomasp, had to ask anyhow.

    I'm thinking maybe the best way to sort soft-alpha is to use separate surfaces only for the highest LOD, then combined as one surface for lower LODs since sorting errors are less noticeable further away (and the alpha can also be mipped down to a harder more-solid gradient, so the translucent texels are even smaller). Hmm, just thinking aloud here, something to play with.
  • Ramucho
    Options
    Offline / Send Message
    Ramucho polycounter lvl 18
    here is an advent children pic;
    as you can see the hair are pretty awesome, love how they shine

    920785_20050730_screen005.jpg
  • CrazyButcher
    Options
    Offline / Send Message
    CrazyButcher polycounter lvl 18
    eric, depending on how the low lod is uv'ed, you could still have some basic hair animation with texture matrix shearing, I think.. like a couple of texture-layers and each get individual uv animation, based on velocity/turning of character, okay probably too fancy for low lod...
    but using multitexturing would not require any sorting, however only works with relative simple meshes...

    btw what about pre-sorting for lets say +x +y +z, and some mixed axis, since one could assume you are never inside of the head. and if you are on the opposite site, you could just use the inverse of your precalculated sort order.

    then in realtime you find the "best bet" precoded axis... I read somewhere that this is done for trees and alike too. and mostly works. maybe even doing a weighted sum of the sort order based on the closest three sortaxis, dunno might be worth a try
  • Ramucho
    Options
    Offline / Send Message
    Ramucho polycounter lvl 18
    just found a bigger picture, looks like they're really using alpha planes but there are a lot of them! Som even for single hairs!

    http://pspmedia.ign.com/psp/image/articl...09065803479.jpg

    The question now is how do they place them? do they have any procedural technique and stuff or is it all done "by hand"?
  • thomasp
    Options
    Offline / Send Message
    thomasp hero character
    why do you think that's alpha planes? they'd need insane texture resolutions to keep it that sharp in close-up. looks more like geometry derived from control-splines to me - there are even some edges visible. in close-up it doesn't look too hot imho. strange, thick hair.

    btw. i guess AC is intended as a HD release? because that kind of texture resolution doesn't seem to make sense for a DVD only movie.
  • Toomas
    Options
    Offline / Send Message
    Toomas polycounter lvl 18
    thomasp: its propably just promo image

    Anyways what made me think that the hair is alpha is when you look how the long air moves it kinda stretches like cloth. Also look how the ends of the hair fade off.
Sign In or Register to comment.