PDA

View Full Version : A simple hair shader


pipari
10-21-2004, 07:00 PM
I managed to find some spare time and cooked up this little shader:

http://www.uta.fi/%7Ern58847/cgtalk/PHair_Example8.jpg

Features:

2 anisotropic specular highlights, with selectable color, glossiness, specular strength (LW specular channel acts as a master channel) and shift.

I have included a simple test scene and object that you can use as a reference. The shader uses different textures to modify specular highlights: The jittering texture (LW's translucency channel) is basically a gray scale version of the color map + some 2d hyperclouds on the top. The second specular texture (LW's ior channel) is used to modulate the specular highlights: You can use this to give the hair a "sparkling" look (in the test object it's a gray scale version of the color map + random noise.

Two different highlights:

http://www.uta.fi/%7Ern58847/cgtalk/PHair_Example5.jpg


Sparkles (modulation texture):

http://www.uta.fi/%7Ern58847/cgtalk/PHair_Example7.jpg


With darker modulation texture:

http://www.uta.fi/%7Ern58847/cgtalk/PHair_Example4.jpg

The file can be found here (http://www.uta.fi/%7Ern58847/cgtalk/P_Hair.zip)

Comments, questions etc. are welcome :) - the skin shader is currently on hold - I'm swamped with work :eek:

-------------------
pipari
-------------------

Panikos
10-21-2004, 07:50 PM
:bounce: G R E A T:bounce:

KOryH
10-21-2004, 08:23 PM
cool I can't wait to play with it.

Shade01
10-21-2004, 08:29 PM
That is excellent. Thank you!

richcz3
10-21-2004, 08:33 PM
Umm That's insane!!!

Excellent work:thumbsup:

richcz3

ztreem
10-21-2004, 09:04 PM
Looks great! may come in handy. :thumbsup:

Panikos
10-21-2004, 11:40 PM
Pipari :)
Your plugin is great.

However while I adjust the values the Surface Sample image doesnt update unless I disable/enable the plugin. Not a major problem, I think it can be fixed easily

Thanks :thumbsup:

xiao_x
10-22-2004, 06:47 AM
hei,cool,very cool plugin,may i know that shader can apply what other material???izzit cloth also can alppy ??just want to know this shader can work at which material except hair

Finally,thanks for the plugin.......is :thumbsup:

T4D
10-22-2004, 10:05 AM
Kickass thanks using it right now :buttrock:

Exper
10-22-2004, 10:40 AM
pipari (the Great) strikes again! :thumbsup: :deal:

Any news about the skin shader? :cool:

Keddy
10-22-2004, 06:55 PM
Wow, Looks great! Thanks for your sharing! :thumbsup:

Julez4001
10-22-2004, 08:06 PM
Fantastic I was just thinking how Max and XSi ave been getting some kool/tons of commerical quality plugins for free and LW been quiet on the homefront...
Not that I mean to bash ppl who code or anything but the developer area has been very off the radar.

This shader, the occulusion shader and dirt has really been a welcome addition.

Remi
10-22-2004, 08:21 PM
Thanks alot for sharing with us. I can't wait to give it a whirl....hat's off to ya:):buttrock:

pipari
10-22-2004, 08:48 PM
Thanks guys :D I hope you find the shader useful

Panikos: The behaviour you described is a common problem with all my plugins and I have been too lazy to fix it (If anyone knows how to fix this pm me, please :) I'll fix it sooner or later ;)

xiao_x: You can use it on other surface types as well. Just play around with it: try different modulation and shifting textures & values etc.

Exper: You are such a flatterer :blush: The skin shader is currently on hold - I'm busy busy busy ;)

If you guys manage to get some decent results with this shader I would like to see them 8)


-------------------
pipari
-------------------

Julez4001
10-22-2004, 08:58 PM
do u have a link to what you got so far on the skin shader or example pictures or a thread.

gerardo
10-23-2004, 06:02 AM
:applause: WOW! Thank you very much Pipari! :applause:

Julez, I think Exper refers to this thread:

http://www.cgtalk.com/showthread.php?t=166228&page=5

Im interested in that shader too :)



Gerardo

Exper
10-23-2004, 09:19 AM
Julez, I think Exper refers to this thread:

http://www.cgtalk.com/showthread.php?t=166228&page=5Yes... indeed! :deal:

jayezon
10-25-2004, 04:43 AM
Vveerryy nice. Thanks for that.

Exper
10-25-2004, 08:43 AM
Exper: You are such a flatterer :blush: The skin shader is currently on hold - I'm busy busy busy ;)No... you deserve! :beer:
We'll patiently wait for the Skin one! :thumbsup:

aurora
10-25-2004, 01:57 PM
This totally kicks a$$. Not only is it great for hair I just tried it on something else and loved the results. Any chance on getting envelopes on the channels, PLEASE?!?!

angel
10-25-2004, 03:13 PM
this shader couldn't have come at a better time, Thanks!:bounce:

BTW this is the first time I use a bounce smilie.

pipari
10-27-2004, 11:17 AM
Exper: mmmkay :beer:

aurora: On something else? That's cool :D I might add envelope support when I have enough time to :wip: the shader.

rest of the guys: You're welcome ;)



-------------------
pipari
-------------------

pipari
10-30-2004, 10:49 AM
OK, here's version 1.1 of the shader :D Few notes:

I Added envelope support for the shader channels and changed the shader name to "P_Hair 1.1". Due to the envelope support this version is not backward compatible with the previous version -> You have to remove all references to the old shader (surfaces' shader lists + LW plugin list) and reinstall the shader (be sure to write down those shader settings before removing the shader). I apologize for the inconvenience :blush:

The shader (http://www.uta.fi/%7Ern58847/cgtalk/P_Hair1.1.zip)

Comments, questions etc. are welcome :) and pretty please, post your results (I'm itching with curiosity 8)


-------------------
pipari
-------------------

pipari
10-30-2004, 10:52 AM
Umm, I forgot to add that the updating bug (the one that Panikos mentioned) is now fixed.


-------------------
pipari
-------------------

Robert Zeltsch
10-30-2004, 12:34 PM
Great work!! :thumbsup: Good for some brushed metal effects:

http://www.flow-m-ocean.de/forum/hair_shader.jpg

Uses one procedural texture in Diffuse and Translucency and rendered with one point light. :)

Thank You

Panikos
10-30-2004, 04:07 PM
Umm, I forgot to add that the updating bug is now fixed.

Pipari, thank you very much. :bounce:

pipari
11-01-2004, 07:59 AM
Errr, it seems that the new zip package I posted has a wrong (ie. previous) version of the shader :banghead: I'll upload corrected package later today. Sorry :blush: (I want to thank keddy who notified me of the problem).

Robert Zeltsch: Thanks for the pic :)

Panikos: You're welcome - no reason to thank me since I posted the old shader :(

-------------------
pipari
-------------------

pipari
11-01-2004, 06:04 PM
I have now uploaded a package containing the real 1.1 version of the shader. Use this link (http://www.uta.fi/%7Ern58847/cgtalk/P_Hair1.1.zip) or the link above.


Have fun :)


-------------------
pipari
-------------------

Panikos
11-01-2004, 08:48 PM
Pipari :)

Thanks.
Now ... everybody waits for the skin shader.

hmmm

Keddy
11-01-2004, 09:07 PM
Hey, Pipari

Thank you very much. :)

Exper
11-02-2004, 07:59 AM
Pipari rulez! :love:

New
11-03-2004, 10:32 AM
Thanks pipari, very useful plugin. :)

pipari
11-04-2004, 07:53 AM
Thanks Panikos, keddy, New & (last but certainly not least :p) Exper.

As I said in the skin shader thread the hair shader is pretty much complete (imo) -> make a feature request if you feel otherwise ;)


-------------------
pipari
-------------------

Julez4001
11-04-2004, 10:31 AM
Pipari rulez!
You have persoanlly restored the kool a$$ lightwave free plugin movement.
It was getting quite slow (and uneventful) there for a minute.
This definitely has "3dsmax-free-plugin" likeness written all over it.

Exper
11-04-2004, 05:06 PM
You have persoanlly restored the kool a$$ lightwave free plugin movement.More than agree... holy words... Julez!

pipari
11-06-2004, 07:32 AM
Pipari rulez!
You have persoanlly restored the kool a$$ lightwave free plugin movement.
It was getting quite slow (and uneventful) there for a minute.
This definitely has "3dsmax-free-plugin" likeness written all over it. More than agree... holy words... Julez! Thanks for your kind words :D I should point out that there are other guys like Skidbladnir(?) who deserve the credit too :)

Here (http://www.uta.fi/%7Ern58847/cgtalk/P_Ambient1.1.zip)'s a new (and a bit faster) version my ambient pass shader

Current features:

Selectable type - general ambient occlusion / backdrop ambient occlusion
Selectable mode: Normal, Additive, Subtractive & Multiply
Max ray length
Sample count

I post some sample images later.

-------------------
pipari
-------------------

ArtisticVisions
11-06-2004, 09:43 PM
Just had the chance to try out the hair shader; love it. :)

pipari: What is the ambient pass shader? (is it your skin shader or a different plugin?

Exper
11-11-2004, 10:26 AM
pipari: What is the ambient pass shader? (is it your skin shader or a different plugin?It's pipari's experimantal occlusion shader! :buttrock:

gerardo
11-12-2004, 04:27 AM
:applause: Excellent and very quick!!! :thumbsup:



Gerardo

pipari
11-15-2004, 07:11 AM
ArtisticVisions: As Exper said the ambient pass shader is an occlusion shader. I call it ambient pass shader because it only does ambient occlusion: it doesn't have lambertian diffuse and/or phong specular. I believe Skidbladnir's plugin has both of those.

gerardo: Thanks :)


Example images will have to wait until my home connection is fixed.

-------------------
pipari
-------------------

gerardo
11-16-2004, 05:30 AM
Oh no, Thanks to you :thumbsup:
For me the most impressive feature is Backdrop; if there was some way to separate the ambient effect (backdrop) of the occlusion effect (disabling it) we could maybe use your excellent plug like a radiosity substitute. Better still if it was possible to use some mode that allows to maintain the diffuse of the surfaces but adding the environmental lighting effect.
As you can see in the attached example, the ambient occlusion pass is very strong and I've had to use the shader in 2 slots (one in additive mode and the other in sustractive mode) that makes slower the render (however is even this way, is quick: less than 2 min) but it could be quicker if this could be made with the same shader in just one slot. I know that your shader isn't designed for this purpose but to be used as a occlusion pass; however it would be very nice if had this option :)



Gerardo

pipari
11-16-2004, 07:06 AM
Oh no, Thanks to you :thumbsup:
For me the most impressive feature is Backdrop; if there was some way to separate the ambient effect (backdrop) of the occlusion effect (disabling it) we could maybe use your excellent plug like a radiosity substitute. Better still if it was possible to use some mode that allows to maintain the diffuse of the surfaces but adding the environmental lighting effect.

As you can see in the attached example, the ambient occlusion pass is very strong and I've had to use the shader in 2 slots (one in additive mode and the other in sustractive mode) that makes slower the render (however is even this way, is quick: less than 2 min) but it could be quicker if this could be made with the same shader in just one slot. I know that your shader isn't designed for this purpose but to be used as a occlusion pass; however it would be very nice if had this option :)

Thanks for thanking me :p Did you try using Multiply mode? According to my (limited) tests multiply mode gives results that are nearly identical with LW's backdrop radiosity. I'm not sure I understand what you mean by separating the ambient effect from the occlusion effect (me stupid :surprised). Could you clarify it a little bit?

It's very easy to add diffuse (and specular) to the shader but that means the calculations have to be done by the shader (AFAIK). The shader currently uses "raw" surface color (color channel + transparency and perhaps luminosity & translucency. I have to test this...) calculated by LW.


-------------------
pipari
-------------------

gerardo
11-16-2004, 08:15 AM
I've tested Multiply but here it darkens and saturates the surfaces (but I'll try again) :)
About separating the ambient effect of occlusion effect (sorry, I haven't expressed it correctly), I referred to achieve the colorations provided by Backdrop, but without the occlusion shades. An effect like fake_irradiance_ilumination plug-in but in a more accurate and instantaneous way; although isn't the purpose of your shader, I know, but I think that LW needs something like an ambient pass or indirect illumination pass (or some plug that can fake this) :bounce:



Gerardo

pipari
11-16-2004, 09:01 AM
I've tested Multiply but here it darkens and saturates the surfaces (but I'll try again) :)
About separating the ambient effect of occlusion effect (sorry, I haven't expressed it correctly), I referred to achieve the colorations provided by Backdrop, but without the occlusion shades. An effect like fake_irradiance_ilumination plug-in but in a more accurate and instantaneous way; although isn't the purpose of your shader, I know, but I think that LW needs something like an ambient pass or indirect illumination pass (or some plug that can fake this) :bounce:

Removing the occlusion shades = removing self shadowing(?). If that's what you mean, there are two ways (I think...) to achieve that and both are about 5min jobs -> I guess I'll add them to the shader :wip:

-------------------
pipari
-------------------

gerardo
11-17-2004, 12:37 AM
That would be excellent!!! :thumbsup:



Gerardo

pipari
11-17-2004, 06:16 AM
Ok gerardo, I have a new version of my ambient pass shader ready. It now has "Backdrop ambient only" option :) I also did couple of performance tweaks :wip:. The .zip is too large (156KB) to post as an attachment -> You'll have to wait until I get it hosted ;) (pm me your email if you're impatient :p)


-------------------
pipari
-------------------

Julez4001
11-17-2004, 10:11 AM
email it to me, and I'll host it...
julez4001@yahoo.com

pipari
11-17-2004, 12:33 PM
email it to me, and I'll host it...
julez4001@yahoo.com
Thanks for your generous offer, Julez :D I've already made other arrangements and the file will be up tomorrow :)


-------------------
pipari
-------------------

NeptuneImaging
11-17-2004, 03:06 PM
Hey, Pipari,

can this hair shader be baked to a texture map?

gerardo
11-18-2004, 12:46 AM
Ok gerardo, I have a new version of my ambient pass shader ready. It now has "Backdrop ambient only" option :) I also did couple of performance tweaks :wip:. The .zip is too large (156KB) to post as an attachment -> You'll have to wait until I get it hosted ;) (pm me your email if you're impatient :p)


-------------------
pipari
-------------------


WOW! how quick! :bounce: Of course that Im interested :bounce: Ive just sent you a PM.
You are very gentile, man! :thumbsup:
Thank you



Gerardo

pipari
11-18-2004, 07:20 AM
Hey, Pipari,

can this hair shader be baked to a texture map?
I haven't tested it that way :surprised but I'm fairly sure that you can bake it :)

Here's (http://www.hobos.it/pipari/P_Ambient1.2.zip) a new version of the ambient pass shader (Thanks Exper for providing the space ;) )


-------------------
pipari
-------------------

Exper
11-18-2004, 09:43 AM
Thanks Exper for providing the space ;)You deserve! :thumbsup:

gerardo
11-19-2004, 06:16 AM
Ok gerardo, I have a new version of my ambient pass shader ready. It now has "Backdrop ambient only" option :) I also did couple of performance tweaks :wip:. The .zip is too large (156KB) to post as an attachment -> You'll have to wait until I get it hosted ;) (pm me your email if you're impatient :p)


-------------------
pipari
-------------------


:bounce: Thanks Pipari!!! :bounce: :applause: works excellently :applause: (this way is almost 100 quicker%), I think that this option is important because when it was integrated in Backdrop, I found the shades very dark, now we can control its intensity separately; using it with an occlusionmap or to bake it and to use it with spinninglights. In the attached example we can notice the difference with the first test.
Thank you very much.



Gerardo

Julez4001
11-19-2004, 11:20 AM
Mosys haders can be baked, haven't found that cannot as of yet....

Gerado
what was the render times and on what machine.

gerardo
11-21-2004, 11:01 PM
Sorry for delay, Julez. Less than one minute PIV 2Ghz.
The advantage of this shader is that you can obtain the ambient effect separated from the occlusion effect, what allows to speed up the render if you to bake this last or you use spinning lights. But something that I would like is that this shader could affect the diffuse and to be used directly in the final render interacting with lights and shadows. :)



Gerardo

pipari
11-22-2004, 04:59 PM
Sorry for delay, Julez. Less than one minute PIV 2Ghz.
The advantage of this shader is that you can obtain the ambient effect separated from the occlusion effect, what allows to speed up the render if you to bake this last or you use spinning lights. But something that I would like is that this shader could affect the diffuse and to be used directly in the final render interacting with lights and shadows. :)
That's a great looking image gerardo :) I'll think about the diffuse (and specular) lighting thing ( :wip: )


-------------------
pipari
-------------------

Exper
11-23-2004, 09:24 AM
That's a great looking image gerardo :) I'll think about the diffuse (and specular) lighting thing ( :wip: )Great news! :bounce: :drool:

doublerr
11-23-2004, 04:50 PM
yo ,i juz need it:)
thanks for sharing
u rox:thumbsup:
thankssss

gerardo
11-24-2004, 01:12 AM
That's a great looking image gerardo :) I'll think about the diffuse (and specular) lighting thing ( :wip: )


-------------------
pipari
-------------------

:thumbsup: Yes, that would be great! :bounce:

Exper
11-25-2004, 04:12 PM
Just a little test. :D

Exper
11-27-2004, 03:38 PM
Just a simple variation. :shrug:

E_Moelzer
11-27-2004, 05:28 PM
Hey Pipari!
Your hair- shader looks awesome.
Great work!
However, I think, that it is way slower, than it should be.
Not sure what the problem is, but it should not slow down the rendering of polygons, that are not affected by it in any way. It seems as if the rendering slows down a lot as soon as it reaches polygons, that are affected by the shader but does not recover anymore (e.g. the skin of my character renders comparably fast until it starts drawing polygons, that are in the shadow of the hair, however from that moment on all skin- polygons render slow, no matter whether they are in the shadow, or not).
Any idea, what is responsible for that? Can you fix it?
Anyway, great work and thanks for sharing!
CU
Elmar

Exper
11-27-2004, 05:59 PM
I fear this is a problem related to Occlusion algorhythm.
I've tested the same speed degradation with other ones.

E_Moelzer
11-28-2004, 03:48 AM
Hey Exper!
I meant the hairshader, not the occlusion- shader.
The hair- shader does not use occlusion, does it? Or do I miss something here?
CU
Elmar

Exper
11-28-2004, 06:42 AM
Oppss... sorry for the misunderstanding.
I'm in such a hurry during the last days... I jump here, read fastly... maybe I shouldn't reply! :argh:

Julez4001
01-07-2005, 03:24 PM
Hey Pipari

Is there a generic tool that you can create that can add/remove ambient occulsion to all surfaces.

gerardo
01-14-2005, 01:51 AM
Julez@: I've been trying to communicate with Pipari for 4 months, but I haven't obtained answer yet. I requested him that he allowed me to be betatester of any of his plug-ins, and he very kindly sent me a new plug to test. I sent him my suggestions in 2 e-mails since I made extensive tests, later I send him several more emails and PM, but I haven't obtained answer from then on; he was just making this for fun, however the concept of his plug is top notch; reason why if somebody knows something about him, please tell us. I hope he is simply very busy and that he is fine.



Gerardo

Panikos
01-14-2005, 02:11 AM
Yes, its a fact that in the networld is like this, unfortunately.
I emailed Pipari 2-3 times.
I want to believe that he is very busy.

Lets wait

Exper
01-14-2005, 06:30 AM
I don't have any news too!

I talked with him often (via email) and he asked me to test a new plug but I was too much in hurry at the time... my last mails (mid/end of december) never get a reply... maybe he is too much busy or he has connection-problems again (already happened in the past). :sad:

Pancho
02-17-2005, 10:24 PM
Came around this thread quite late, but probably the hair shader might come in pretty handy. So far I do like the results quite much, BUT:

Is it possible to change the direction of the shading on my object (in certain regions)?

a) UV map doesn't seem to work, as there is no such field (like within the BRDF shader where you can specify a map). Then you'd be able to deform the UV map and give the shading a certain direction.

b) Morph target. Either deform the master or target and then morph. The shading should follow the morph.

Unfortunately both methods do not work. At least for me. If I do something wrong or if the shader doesn't work this way isn't obvious to me. Could somebody give me a hint?

This would be by far the greatest way to fake short fur (which got a certain flow on it's host). Hopefully there's a way.

Cheers
Pancho

hesido
05-27-2005, 07:35 PM
Pipari, what a great contribution to the community! If I did a quarter of what you did, I'd start screaming on every possible forum, paste the link all over the place, and brag in the local pub! Well these are great.. But it is hard to pickup the latest version :)

Hmm, people are talking about the skin plugin, and I really wonder what can be done with it, is it out yet for us public ??

claws_33
05-28-2005, 12:33 AM
I got this plugin intending to use it for shading fur. i already colored it but not only do i have no idea how to use this, but can i use it as a bump map?

threedeworks
05-28-2005, 12:46 PM
anyone willing to compile it for OSX please?

markus

CGTalk Moderation
05-28-2005, 12:46 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.