Cycles's GSoC 2018 project: new hair shader! Expectations?

does this setup provide a value and a variance interval to the chosen value or is the ramdomness unconstrained ?

I’m using the Hair Info’s random value, so AFAIK it’s unconstrained.
Cycles doesn’t seem to have a pure “Random Value” for doing this.

My feedback on the hair shader:

  1. Direct coloring and Melanin color is a choice of the one or the other. Direct coloring makes sense, but Melanin mode should still have Tint/Dye color, like in other renderers. This way, you can kind of emulate dyed hair, or you can do physically based melanin hair, and then use Tint/Dye parameter for some artistic control. It would be basically just RGB multiply over the melanin color, defaulting to white of course, so no tinting occurs by default.

  2. I’d personally say it would be more intuitive to have one roughness parameter for secondary reflection, and one anisotropy parameter, which stretches reflection across U when set to positive values, and across V when it’s set to negative values. That way one doesn’t need to keep the U and V values in relative synchronization when tweaking roughness.

For example when your U roughness is 0.1 and V roughness 0.2, then to keep relative roughness same, you need to multiply both numbers by desire amount. With one roughness parameter and one anisotropy parameter, you can set up anisotropy the way you want and then tweak roughness.

  1. There may be something wrong with the offset value. It requires non zero value for hair to actually output something meaningful. In general, it would be good to take a look at the defaults, and make sure they output something good looking out of the box.

  2. Few modern hair shaders, most of the introduced last year have also built in “Glint” parameter, which randomizes normals along the hairs to emulate imperfections in hair structure. I guess, having at least normal input in the shader would allow us to do it manually.

  3. Not sure absorption coefficient mode should make it in the final UI. It may be good for programmers but will probably just add another layer of confusion for users.

Indeed, “Glint” parameter would be very useful!

1 Like

about 5-it dosen’t hurt to have it as an option really, if there is a database of values somewhere it could be handy to use for quick results

Adding to this, I’m not sure if this would even be on the roadmap, but when I have looked at my beagle’s white fur in the sun, a close look revealed a certain level of coloration within the highlights (ie. some sort of spectral effect).

Again, I think you should concentrate on getting all of the current shading qualities (in the hair principled shader node) to a fully working condition first (as the current stuff includes the most important aspects).

1 Like

best approach I think is to have the current shader as the basic hair shader node meant for use in an extensive material tree (while removing the old implementation since it uses a different, non energy conserving algorithm), then extend this one to a new (principled) ubershader with all the bells and whistles in a new node later.

I can’t seem to find the Cycles Hair Rendering settings (for ribbon, curve, etc. settings). Are these hidden in your build?

I like the look that i got with the new shader, pretty easy to use, this is just the default and i just changed the hair color, which is straight forward if you compare to the shader in Blender 2.79.
Your shader

and now Blender 2.79 shader of course this is not a fair comparison but we the same color here.

And the node

keep up good work :slight_smile:

They have been changed long ago, they are now here →

Hi.
From some commit of yesterday I think, I am getting an error when trying to compile/build on Linux:
http://pasteall.org/985944

Apologies for that one! 08f3536d17ffe1c5a877d752b4d4a823ac73f11b should fix it.

1 Like

You do not need to apologize, there is no problem at all.
It’s working now, thanks!

1 Like

Wait so we can only have one type of hair primitive per scene in Cycles now? Blender devs make some infuriating design decisions sometimes…

Hey everyone,

I added the ability to tint the hair and randomize the Melanin and Roughness values.

The first one should work like V-Ray’s, i.e. lower the melanin to some suitable value and then choose your desired dye (like in our shader’s Direct coloring mode). Do notice that I haven’t (yet) added randomization to the dye, if anyone finds it useful, let me know!

Melanin and Roughness Randomization works by specifying how much (less) Melanin/Roughness you wish to add to the hair, e.g.

  • 0 == no randomization allowed
  • 0.5 == hair is allowed to have as much as 50% less melanin/roughness
  • 1 == fully random properties, up to the desired melanin/roughness values

Please note that the shader requires Hair Info->Random to be socketed to Random. Caveats:

  • If you wish to disable randomization,
    • unsocket and set Random to 1.0
    • or set the Randomization values to 0.0.
  • Randomization will not work with Interpolated children, since that doesn’t alter the value provided by Hair Info. Use None and add manually more strands, or use Simple to generate the children.

Let me know if you have any comments!

2 Likes

Maybe an stupid question related to hair in Blender (not related to the shader). In Blender we do not have the possibility that after running hair dynamic simulation, choose a frame and set that frame position as a new hair rest position? In this way, we can share haircutting styles with other users, without having hair dynamics enabled, without having to share cache or without the need for the other user to run simulation again. Also, to be able to particle edit that new rest position.

1 Like

Great, thank you for the effort and glad to see that randomization made it in the shader
i’ll be waiting for the refreshed builds to test it again

We have always had one hair primitive per scene in Cycles. The UI arrangement just made it look like you could choose the primitive type per-system. You never actually could, those settings were common to all particle systems in the scene. Worse, since it is per-scene, if you had a linked character it wouldn’t use the primitive settings in the source file, it would use them from the render file. Which you couldn’t change unless you added an object with hair in the render file.

Agreed, it would’ve only been useful if the hair primitive type could be changed on a per-particle system basis and not per-scene (which made the primitive options misleading).

So in a sense, it should only return if we can say, have a different primitive type for animal fur and grass.

The Principled shader examples here look great by the way, seems to be very easy to use.

I didn’t realize that. Is there a technical reason it’s like this? There are definitely shots and cases where different primitives are better than others, and not at all out of the question for those cases to exist side-by-side in a single shot (i.e. a furry creature and a character with long hair). I’ve worked on Arnold shots that would have been a pain to pull off in compositing if there weren’t primitive overrides.