physically based hair

3Delight has included the “hair” distribution in the trace() shadeop for quite a while already, but I only managed to build my little shader recently.

The difference between a trace()-based solution and older Marschner-related DS shaders is, well, not necessarily immediately visible in the final render, but it’s quite significant internally.

What older shaders do is calculate Marschner reflection and overlay it on top of some (basically arbitrary) diffuse shading meant to actually give the hair some luminous colour (Marschner alone primarily does the highlights, it’s not a model that will render you that fluffy blond hair).

The trace()-based solution does something which I think is also related to Marschner (we get the R, TT and TRT lobes), and then it rolls up its sleeves and calculates realistic light scattering inside a hair fiber based on a colour absorption coefficient, which gives the hair its “general” colour.

You can’t expect this process to be lightning fast, but fast enough, I think – when we don’t use GI, that is (then – forty minutes and counting for a single tiny head? nope, that won’t do).

Given that documentation is quite sparse, I think I’m simply doing something wrong. I should try setting the “maxhairdepth” RiAttribute to 0 instead of 1 and see what happens (looking at the Maya scripts, it seems to be at zero in the 3DL Maya hair material). I think I am excluding the RiCurves from GI already, but more checks RIB-wise are required to really make sure.

Oh BTW. Excluding this shader from GI makes all the sense because the trace()-based solution “sees” the environment by itself (it can even light itself using an HDR map). Moreover, I’m excluding the “ambient” light category from the illuminance() – with the bsdf() picking up the IBL from the GI light, the hair looks overexposed.

The “normal” render times are a bit under 6 minutes for a delta light (Physical Sun, left) and a bit under 7 minutes for a path-traced area light (right).

The hair roughness is set too high, I think, so the hair doesn’t really look shiny; but that was just a test.


Another downside is that LAMH won’t save the shader you attach to its objects when you save the scene – it loads its own. So presets should be saved out separately. I haven’t yet tried with Garibaldi because I find the workaround to make it work with scripted rendering rather tedious (and hey, that’s the best workaround I could come up with, and I don’t think anyone else ever came up with a better one).


Comment here

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s