Jump to content


Marschner hair model


  • Please log in to reply
87 replies to this topic

#1 ssh

ssh

    Peon

  • Members
  • Pip
  • 54 posts
  • Joined: 01-August 08
  • Location:Toronto
  • Name:Sergey Shlyaev

Posted 27 December 2010 - 09:48 AM

Hello,

Just would like to share hair shader I've done.
This shader implements well known Marschner model proposed here:
http://www.graphics....r-sg03final.pdf

Video on Vimeo:

View on Vimeo.

Youtube:
http://www.youtube.com/watch?v=IYMF2a_ts2U

Tested both in H10 and H11.

furryBall_web.jpg

hair_web.jpg

Shader Parameters:
Diffuse color and intensity.
please note that for dark hair diffuse intensity is usually very small

Overall specular intensity and color. Computed speculars are multiplied with this values.
This parameters are not physically correct and are provided for convinience only.

Different light masks and categories lets specify which lights are contributing to diffuse and specular computation.

Specular components:
Primary Highlight (R ): Strong primary specular peak.
Secondary Highlight (TRT): Colored secondary peak.
Backlight (TT): Colored component that appears in back lighting situations. That is the bright halo around the hair.

Each component has it's own intensity and color multipliers for ease of use and tuning.

Shift sets shift amount of speculars from root to tip.
Width sets width of speculars. The more the width the wider they are.

Usage:
1. Download and Install ssh_marschner_hair.otl (File->Install Digital Asset Library)
2. In SHOP context start typing ssh_marschner_hair_model and choose this shader.

Update: There are hairDiffuseExport and hairSpecularExport export variables so diffuse and specular data may be separated.

UPDATE:
Shader supports texture maps as well as ramps that allows to remap colors and opacity from root to tip.
Latest version of the shader is avaliable here:
ssh_marschner_hair

Attached Files


Edited by ssh, 13 October 2011 - 01:36 AM.


#2 Hazoc

Hazoc

    Initiate

  • Members
  • PipPip
  • 140 posts
  • Joined: 12-October 06

Posted 27 December 2010 - 12:53 PM

Haha, that's insane. Thanks for sharing! Was it hard to implement ?

#3 Marc

Marc

    odforce ninja : NVTS

  • Administrators
  • 4,042 posts
  • Joined: 25-June 01
  • Location:R&H - Vancouver
  • Name:Marc Horsfield

Posted 27 December 2010 - 02:17 PM

That's very cool, thanks for sharing Sergey!

M
"I am mighty! I have a glow you cannot see. I have a heart as big as the moon, as warm as bathwater. We're superheroes, man! We don't have time to be charming! The boots of evil were made for walking. We're watching the big picture, friend. We know the score. We are a public service, not glamour boys! Not captains of industry! Not makers of things! Keep your vulgar moneys! We are a justice sandwich, no toppings necessary!

#4 Macha

Macha

    Grand Master

  • Members
  • PipPipPipPipPip
  • 1,654 posts
  • Joined: 23-July 08
  • Location:The Small Big P
  • Name:Marc ♥

Posted 27 December 2010 - 02:58 PM

Thank you, that's very amazing work!
My Vimeo

LinkedIn

improve side effects - use haskell


#5 Jason

Jason

    King Tapir

  • Administrators
  • 3,708 posts
  • Joined: 08-November 00
  • Name:Jason Iversen

Posted 27 December 2010 - 06:20 PM

Your results look nice and stable! Thank you very much for this lovely christmas gift. I do hope you can one day share the source code with us :)
jason iversen
++odforce guy, and supervisor @ r+h, jiversen-at-rhythm
odforce g+ page: https://plus.google.com/103473736257525043693

#6 ssh

ssh

    Peon

  • Members
  • Pip
  • 54 posts
  • Joined: 01-August 08
  • Location:Toronto
  • Name:Sergey Shlyaev

Posted 28 December 2010 - 02:22 AM

Thank you guys!
I'm greatly appreciate your feedback!

View PostHazoc, on 27 December 2010 - 12:53 PM, said:

Was it hard to implement ?

Not very hard. It's not rocket science. :)

View PostJason, on 27 December 2010 - 06:20 PM, said:

I do hope you can one day share the source code with us :)

Yes, why not. I'll think about it. :)

#7 Hazoc

Hazoc

    Initiate

  • Members
  • PipPip
  • 140 posts
  • Joined: 12-October 06

Posted 28 December 2010 - 09:33 AM

View Postssh, on 28 December 2010 - 02:22 AM, said:

Not very hard. It's not rocket science. :)

That's right. But the shader is pretty huge, I've only done some simple ones. How do you start something like that ? Build first some of the modules indipendently and see that their contribution to the ouput looks correct or what ?

#8 Jason

Jason

    King Tapir

  • Administrators
  • 3,708 posts
  • Joined: 08-November 00
  • Name:Jason Iversen

Posted 28 December 2010 - 01:36 PM

View Postssh, on 28 December 2010 - 02:22 AM, said:

Yes, why not. I'll think about it. :)

I'm sure the community would very much appreciate it ;)
jason iversen
++odforce guy, and supervisor @ r+h, jiversen-at-rhythm
odforce g+ page: https://plus.google.com/103473736257525043693

#9 ssh

ssh

    Peon

  • Members
  • Pip
  • 54 posts
  • Joined: 01-August 08
  • Location:Toronto
  • Name:Sergey Shlyaev

Posted 30 December 2010 - 04:44 AM

View PostHazoc, on 28 December 2010 - 09:33 AM, said:

How do you start something like that ? Build first some of the modules indipendently and see that their contribution to the ouput looks correct or what ?

Yes, something like this.

I definitely had to read this paper several times before understand anything.
Next, I figured out that there are simple things and there are complicated ones.

For example, compute R component is relatively very simple and computing TRT is much more complicated.
So, starting with simple ones, get proper results and then getting into more complex stuff. :)

If you have any questions - please ask.

#10 ssh

ssh

    Peon

  • Members
  • Pip
  • 54 posts
  • Joined: 01-August 08
  • Location:Toronto
  • Name:Sergey Shlyaev

Posted 06 January 2011 - 11:02 AM

Forgot to mention: there are hairDiffuseExport and hairSpecularExport export variables so diffuse and specular data may be separated.

#11 Matt_K

Matt_K

    Initiate

  • Members
  • PipPip
  • 201 posts
  • Joined: 03-June 04
  • Location:Cape Town
  • Name:Matthew Kearney

Posted 07 January 2011 - 06:49 AM

Thanks Sergey, looks good!

Matt.
---------------------------------------------------------------------------------------------------------------------------
"Reality is merely an illusion, albeit a very persistent one." - Albert Einstein.

#12 Serg

Serg

    Peon

  • Members
  • Pip
  • 94 posts
  • Joined: 19-August 06

Posted 08 January 2011 - 05:00 AM

That is fantastic Sergey, Thanks! :)

S




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users