ssh Posted December 27, 2010 Share Posted December 27, 2010 (edited) 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: http://vimeo.com/18197441 Youtube: Tested both in H10 and H11. 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 ssh_marschner_hair.otl Edited October 13, 2011 by ssh Quote Link to comment Share on other sites More sharing options...
Hazoc Posted December 27, 2010 Share Posted December 27, 2010 Haha, that's insane. Thanks for sharing! Was it hard to implement ? Quote Link to comment Share on other sites More sharing options...
Marc Posted December 27, 2010 Share Posted December 27, 2010 That's very cool, thanks for sharing Sergey! M Quote Link to comment Share on other sites More sharing options...
Macha Posted December 27, 2010 Share Posted December 27, 2010 Thank you, that's very amazing work! Quote Link to comment Share on other sites More sharing options...
Jason Posted December 28, 2010 Share Posted December 28, 2010 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 Quote Link to comment Share on other sites More sharing options...
ssh Posted December 28, 2010 Author Share Posted December 28, 2010 Thank you guys! I'm greatly appreciate your feedback! Was it hard to implement ? Not very hard. It's not rocket science. I do hope you can one day share the source code with us Yes, why not. I'll think about it. Quote Link to comment Share on other sites More sharing options...
Hazoc Posted December 28, 2010 Share Posted December 28, 2010 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 ? Quote Link to comment Share on other sites More sharing options...
Jason Posted December 28, 2010 Share Posted December 28, 2010 Yes, why not. I'll think about it. I'm sure the community would very much appreciate it Quote Link to comment Share on other sites More sharing options...
ssh Posted December 30, 2010 Author Share Posted December 30, 2010 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. Quote Link to comment Share on other sites More sharing options...
ssh Posted January 6, 2011 Author Share Posted January 6, 2011 Forgot to mention: there are hairDiffuseExport and hairSpecularExport export variables so diffuse and specular data may be separated. Quote Link to comment Share on other sites More sharing options...
Matt_K Posted January 7, 2011 Share Posted January 7, 2011 Thanks Sergey, looks good! Matt. Quote Link to comment Share on other sites More sharing options...
Serg Posted January 8, 2011 Share Posted January 8, 2011 That is fantastic Sergey, Thanks! S Quote Link to comment Share on other sites More sharing options...
gyepes Posted April 10, 2011 Share Posted April 10, 2011 It's great that you posted this Sergey, I've started using Marschner model at my work recently and I feel it lights more naturally than Kajiya. I find the biggest difference to be in the way it responds to rim lights... I haven't played around with your implementation, but I'm glad you pursued this effort and shared your results! I believe at last year's SIGGRAPH there was a paper (can't find it unfortunately) that presented a simplified set of shader controls for the Marschner model, much more aritst friendly and easier to digest. Just FYI, in case you can find the paper and feel it's useful. cheers! Quote Link to comment Share on other sites More sharing options...
ssh Posted April 11, 2011 Author Share Posted April 11, 2011 Thanks! Probably you are talking about this paper: %20An%20Artist%20Friendly%20Hair%20Shading%20System.pdf"]An Artist Friendly Hair Shading System It's from Siggraph 2010 and I've took some ideas from it. There is another great paper about hair: %20Efficient%20Implementation%20of%20the%20Dual%20Scattering%20Model%20in%20RenderMan.pdf"]Efficient Implementation of the Dual Scattering Model in RenderMan I wish I had time to implement it. Quote Link to comment Share on other sites More sharing options...
abvfx Posted April 12, 2011 Share Posted April 12, 2011 thanks Sergey, but for some reason the shader doesnt appear to be working for me. :/ I had a look in the code part of the shader(From the Type Properties) and it had one line, ÀÜ): Don't know if thats to be expected. Quote Link to comment Share on other sites More sharing options...
ssh Posted April 12, 2011 Author Share Posted April 12, 2011 (edited) Would you please refine how it's not working? The result is all black, the result is all white? Hair is disappearing? If it's all white maybe the lights are very strong. Please try lowering primary highlight's weight to values like 0.2 for example. Also setting primary highlight's width to values like 2 might help. If this does not helps would you please post your scene? Edited April 12, 2011 by ssh Quote Link to comment Share on other sites More sharing options...
abvfx Posted April 12, 2011 Share Posted April 12, 2011 Yep i got it working now. The settings you mentioned helped. Also increasing the diffuse intensity. Are there plans to allow maps to control color & spec attributes. Its very nice. Thanks for sharing this great work. Quote Link to comment Share on other sites More sharing options...
ssh Posted April 12, 2011 Author Share Posted April 12, 2011 (edited) Thanks, glad it's useful for you! Definitely I'll add texture and ramps controls as soon as I get some time. Edited April 12, 2011 by ssh Quote Link to comment Share on other sites More sharing options...
abvfx Posted April 12, 2011 Share Posted April 12, 2011 (edited) Very cool sir. For now, its time to play . Am i right in thinking this was written for the micropolygon renderer? If there is a way do i need to do something special to get it to work with pbr? Either way its very very cool. Edited April 12, 2011 by phrenzy84 Quote Link to comment Share on other sites More sharing options...
ssh Posted April 12, 2011 Author Share Posted April 12, 2011 (edited) Well, I think currently it will not work with pbr engine. As far as I understand from docs, currently it's not possible to create your own scattering function from scratch. From docs: "You don’t write the scattering function yourself. You create BSDFs by combining primitive BSDFs using addition, multiplication, and scalar multiplication." It's here: http://www.sidefx.com/docs/houdini11.0/vex/pbr Also, found this on SESI forum: "Currently its not possible to create BSDFs on your own, either via VEX or the HDK. There has been talk that in future versions of Houdini this may be possible but the VEX language itself would need to be improved in order to facilitate this." Creating BDSF for PBR So, looks like we have to wait for the next versions. However, shader works with micropolygon and raytrace engines. Edited April 13, 2011 by ssh Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.