Home Technical Talk

Baking Hair & Fur for Games MiniTutorial

My tutorial writing skills are no where near where they should be. Re-reading it I think I can make it much clearer. I'll take another stab at it.

Hair04.jpg
1) Plot your hair guides using splines. Align your splines so they will form poly strips. For the purpose of this example it will look as simple as 3.

2) Select the first spline on the left and under the Geometry roll out turn on <font color="orange">Attach</font> and click the next spline in the poly strip. You are making the vertical edges for the poly strip.
- Keep attaching splines until all the splines that make up that strip are connected. You should have something that looks like 2. One spline with a few floating edge segments.
- Name this object <font color="red">HairLOW</font>
- <font color="orange">Clone the object</font> and name it <font color="green">HairHIGH</font>, we'll be coming back to this in a min.

3) Select <font color="red">HairLOW</font> and under the </font>[/b][/i]Geometry roll out</font>[/b][/i] turn on <font color="orange">Cross Section</font> (should be under the attach button you used earlier).
- Following the same pattern as above selecting each segment. The cross section tool should draw dotted lines from one segment to the next when you are finished it should have built all the edges to your poly strip and should look like 3.
- Add a <font color="orange">Surface modifier</font>, then the <font color="orange">Edit Poly</font>. You can collapse the history stack on this object if you wish.

4) Select the <font color="green">HairHIGH</font> spline. Apply the modifier <font color="orange">Hair and Fur (WSM)</font> it should be close to the top of the list.
- Under the <font color="orange">tools roll out > Presets > load</font> a preset hair type, it might take a min to load. You can take this time to tweak the hair or leave it as is.

5) Switch to <font color="orange">perspective viewport</font> (hair and fur will not render from the ortho views front, left, right, ect)
- Select the <font color="red">HairLOW</font> object and adjust the object so it fits around <font color="green">HairHIGH</font>.
- At this point it might be a good idea to set your render output size to something square like 512x512 and turn on Safe Frame Mode so you can see the bounds of the render area.
- Render out a <font color="orange">32bit TGA with Pre-Multiplied</font> checked, this will give you a nice alpha mask to use as an opacity map.
Note: If you think you might have to render this clump again, you can create a camera as a viewport place holder. Click <font color="orange">Views > Create Camera From View</font>. You can switch your viewport back to perspective so you don't accidentally move the camera. Switch the viewport back to this camera if you need to re-render this clump of hair.
- Apply the <font color="orange">Unwrap UVW</font> modifier pick <font color="orange">Planar</font> and select <font color="orange">align to view</font> and then click <font color="orange">fit</font>. The Yellow Unwrap projection should almost match the bounds of the Safe Frame. If not you can adjust it using the scale tool or the UV Editor.
- Hide <font color="green">HairHIGH</font>

6) Create a <font color="orange">new material</font> placing the TGA you just rendered in the <font color="orange">defuse and opacity map slots</font>. Apply it to <font color="red"><font color="orange">HairLOW</font></font> Under the <font color="orange">opacity map > Bitmap Parameters rollout > Mono Channel Output: set it to Alpha</font>.

7) Do that a few more times to get a few different clumps or copy a more complex hair style. Once you get the work flow down, you can block out clumps of hair and fairly accurately copy a high poly hair style.

Replies

  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    Nice work. As far as tutorials go, it could use a few more images to describe the actions. Its fine for most experienced folks, but a few more images might go a long way with the beginners out there.

    Also, some end-result images wouldn't hurt wink.gif
  • Mark Dygert
    Ok, went back over and cleaned it up a bit. I'm no Ben Mathis thats for sure =P
  • Psyk0
    Offline / Send Message
    Psyk0 polycounter lvl 18
    Hey that's pretty clever! thanks a lot smile.gif
  • FatAssasin
    Offline / Send Message
    FatAssasin polycounter lvl 18
  • seforin
    Offline / Send Message
    seforin polycounter lvl 17
    you sir, have made my day entirely. I was needing to figure out how to safley render out hair to get the effect I want, MAGNIFICENT!


    also vig, check out my new thread in pimping and previews, think you might like what im doing smile.gif
  • Miguelito
    Offline / Send Message
    Miguelito polycounter lvl 18
    The problem with this technique is that it is almost impossible to simulate a hairstyle with close long hair (say longer than 5cm). I'm fighting right now at work with this problem. All I can do is render my hairstyle from different angles with zero spec and than mix it together in ps. Also I have problems to get convincing/ realistic specular maps for it. I know I could just use a render with spec for that but the result is crappy. For god's sake if Max would only be able to "really" bake it.
  • Noren
    Offline / Send Message
    Noren polycounter lvl 19
    An anisotropic shader can help with the specular. Or really fine normals, but that's prone to flicker.

    Great tutorial! smile.gif
    For things like animals I do the hair-styling on the uv's transferred to the mesh via channelinfo and render it from the top.
  • Mark Dygert
    Seforin, awesome!

    Miguelito, I don't understand the 5cm restriction could you explain? I've used it to make long haired characters and it works really well. Of course you still run into the pain of animating long hair... It will make hair as long and as complex as the spline. I showed the most basic approach (short poly strip) because I didn't want it to be overly complicated.

    If you mean the hair frizzes out toward the end making it hard to capture in the render, then you can adjust the "Frizz Parameters". You also might want to select all the verts in the HairHIGH and from the right click quad menu, set them to smooth instead of corner.

    Also this method isn't meant to capture hair applied to a scalp mesh but capture hair using well placed splines that are also easily turned into polygon strips. Think of it as a way to block out hair in poly strips and save yourself some time drawing hair, or at the very least give yourself a base to draw on. You need to plot out your hair planes and be wise where you put the splines/planes. The standard high poly scalp method can't be used here, at least not well, which is what I think your problem is?

    Also you can Convert the hair to a spline or a mesh and use the render to texture feature. However you still need to be smart about both meshes and standard RTT guidelines would apply. It is a good idea to render out a nice bump and spec map if you want but I wasn't going to drag the tutorial on longer than it is just to cover those tiny steps. The tutorial is a base to build off of and get people thinking about the hair/fur features in a different light.
  • Miguelito
    Offline / Send Message
    Miguelito polycounter lvl 18
    Converting the hair into a mesh sounds nice but practically it is unusable. To get a really nice result you really need a very high amount of hair (say 30000 for a whole hairstyle). Max is not able to do that. The highest amount for me was like 5k.
    Take him as an example: georgeclooney.jpg
    See close hair. If the hair was lose than it could have any length and your method (which was also used in Gears of War btw wink.gif) would work.
    Planes are probably not the best solution here I think. So I make a "helmet" and want to bake my whole Hair onto that. In this case rendering the hair from different angels and then mixing together in ps doesnt give a convincing result at least not for me...
  • Mark Dygert
    You might not be able to crank one modifier up to 30,000 but max handles that number fairly well if you spread it across several modifiers. You can then bake that into a helmet if you wish. Personally for the image you posted, I would sculpt it in ZBrush or MudBox. I don't know a single artist that would try and do that hair style using hair planes, which is what this tutorial outlines...

    The method I outlined won't fit every hair style and is meant to create hair planes, not helmets. I'm sorry if I somehow lead to that conclusion. I mostly use it for medium to long hair types, mostly on females and for grass planes. Of course characters that work better with hair helmets should use that method.

    Hopefully this tutorial made you aware of the hair/fur modifier and how easy it is to bang out several types of hair planes, quickly. I mostly wanted to draw awareness to the fact that it shouldn't be ignored because it is mostly used for high poly pipelines.
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    Does the Hair and fur not have the option to convert it's strands to splines (and then to a mesh)? It'd be a quick way to create the actual geo.

    You could then render the nice hair onto a couple of the low poly mesh objects and then Uv the rest to match.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    Ornatrix, though it costs, is a far superior hair system, and has a "convert to mesh" modifier, that doesn't kill the hair system, so you can still fully style it, but it converts it to regular tubes that you can do anything you want to, like any other geometry. Vig's process is exactly what we were using for some Tony Hawk stuff.

    The eyebrows and hair in this image are done using ornatrix. I toyed with using them for the texture, but ended up only using the eyebrows. I made the hair into geometry, but planes, and then reduced the hair count till it was an acceptable level.

    http://www.poopinmymouth.com/net/pcount/agust/hi_poly_06.jpg

    poop.gif
  • Joao Sapiro
    Offline / Send Message
    Joao Sapiro sublime tool
    this thread is full of usefull info ! thank you !
  • Mark Dygert
    I think I could really like Ornatrix, especially for the height maps, what a good idea. It looks like it handles hair dynamically also which could be a nice for cinematics. I'll have to look into it more, thanks Ben!
    I'm not sure we can use it for commercial use... Our lawyers are pretty twitchy about using free stuff.

    Rick, yep it has a convert to mesh and spline feature and technically you can do short hair with it but it's been my experience that its faster to just sculpt it rather than mess with combing and styling.
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    I quickly tried the convert to mesh - and it converted every strand to polygons. Max fell over, dribbled a bit.

    I've been playing with the idea of writing a script that creates hair planes, based on underlying geo, presets, hair length etc. Got parts of it working but I'm bogged down at work at the minute.
  • Mark Dygert
    I think the default number of segments per strand is 45. You might get better results with a lower number but I wouldn't hold my breath. Splines might be easier to work with if you can globally set them all to view at a lower segment count, but render at a higher segment count.

    It would be neat if you can turn each strand into a meta-blob and have them join into a hair helmet. I imagine developing and testing that would be a nightmare... The stands would have to be pretty thick and sparse to not kill max =/
  • Xaltar
    Offline / Send Message
    Xaltar polycounter lvl 17
    Bumped for coolness. I am going to give this a go on my current WIP, thanks again Vig smile.gif
Sign In or Register to comment.