9
$\begingroup$

I got a scene with a lot of fur (really dense hair particles). There are 1000 particles x 750 interpolated ones (with clump curve and kink) per object. Obviously, this is really slow to render and takes too much RAM to render it on GPU or on a render farm.

My idea is:

  • Create a low-poly mesh consisted of a bunch of planes (like trees in games) that roughly fits the object. It would be nice to adapt those planes in iterations until they really fit the fur.
  • Unwrap the mesh
  • Bake all the essential information of the particle system to a texture. Each part of a hair should select the closest (best fitting) plane and gets baked to it
  • Render the scene in almost no time at all

I'm pretty sure this isn't possible since I am searching for something similar for a while, but are there ways to at least approximate this workflow or parts of it? The only thing I found is this one but I don't know how to use it and if it works in my situation.

$\endgroup$
12
$\begingroup$

I have a technique which might be unorthodox but very efficient. The idea is to deform your mesh into its UV map while keeping the hair attached to it, so you can render it into a UV texture :

enter image description here

I've used this technique on one model so far and it worked well. Here's a part of the result :

bake fur to texture fur texture

Downsides

  1. it doesn't perform well on long or clumped hair
  2. it renders noticeable seams on the islands borders

How to prevent them as much as possible:

  1. Prefer sculpting (combing) your hair manually instead of using the Clump property
  2. use as few UV islands as possible. For that, I strongly recommend avoiding Blender's built-in UV unwrapping (which introduces important distortions) and instead, using the SLIM algorithm. You can use it by either installing the original standalone program (not the best because it requires to triangulate your mesh and split the seam edges) or better, by building the Blender SLIM branch (much easier to play with but might be harder to install depending on your OS). Hopefully this amazing algorithm will get implemented in an official release some day.

Now, to deform your mesh into its UV map, you need the UV Shape add-on (not yet updated for 2.8). Once you have it enabled :

  • duplicate your model
  • put the copy on another layer
  • select your edge seams (select only one and then click on Select > Select Similar > Seam)
  • perform an Edge Split
  • in Object mode, select the UV map you want your mesh to deform into
  • in the Extended Tools tab of the tool shelf, enable "Use Active Map"
  • leave "Rescale Islands" enabled to keep hair density consistent
  • click on "Create UV shape". This creates a shapekey. The hair should deform well with the mesh. Personally I did it with a rabbit's fur and it worked perfectly. Tell me in a comment if that didn't go well for you.
  • select the created shapekey
  • in Edit mode, top view, pack your islands in a square (in 3D view of course).You can rotate islands but don't rescale anything or the hair density will change.
  • create an orthographic camera and put it on top view
  • adjust the orthographic scale so the flattened mesh fits in the frame
  • project UVs from view
  • in UV/Image Editor, ensure the UV map fits the UV square. If not, don't rescale directly in the UV/Image Editor. Instead, zoom or unzoom your ortho camera and reproject UVs.
  • remove any lighting in your scene and set the World color to white
  • Render with the orthographic camera
  • Save the image

Now you can bake this texture on the original UV map :

  • on the non-original model, create a simple diffuse material with the rendered image as the color texture
  • select the non-original model and then the original
  • bake the diffuse color from selected to active (make sure you have an image node selected to bake into)

and voilà !

You can even render a hair normal map using a camera normal material : camera based normal material

Although you may want to combine it with the normal map from the hi-res mesh if you have one (I have to add a screenshot on how to combine normal maps with Cycles nodes)

$\endgroup$
  • $\begingroup$ About the normals rendering, wow, great answer! Thanks for sharing. Blender uses the screen up as the +Y vector, but most engines seem to consider screen down as +Y. So a way to do that is to do a (1 - x) on the Y axis of the normal. Check it out: https://s14.postimg.org/nzktb3ald/blender_Alternative_Normal_Nodes.png $\endgroup$ – R. Navega Feb 11 '18 at 23:56
  • $\begingroup$ How do you go from the flat UV view to the 3d mesh view? I didn't know that was a thing $\endgroup$ – MicroMachine May 15 '18 at 23:32
  • $\begingroup$ Not sure what you mean but if you mean "how did I deform the mesh into its UV map", I explained it right before the bullet points. $\endgroup$ – ChameleonScales May 17 '18 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.