PDA

View Full Version : p_HairTK and Shave Setup


vg1
10-04-2009, 04:16 PM
Hello,

I was wondering if anyone could take the time to explain how to setup the connection between p_HairTK and Shave.

I am familiar on how to setup p_HairTK with Maya Fur following DJX's explanation in his blog.
http://www.djx.com.au/blog/2009/04/14/p_hairtk-p_hairtk_shadow-p_shader_replacer/

I have not figured out how to get this working with shave. What exactly must be connected into the shader_replacer node from Shave. I have attempted to connected the given transform node from the shave fur but with no success.

Or is the setup for Shave/p_HairTK completely different from what David explains in his blog for the Maya Fur/p_HairTK setup?

Any feedback is greatly appreciated.

Thank you

zerogee
10-05-2009, 07:37 AM
just assign the p_Hair to the actual shave node and uncheck the override geom shader on the shaveShape.
For advanced shadow tweaking place the p_HairTK_shadow to the shadow slot. Plus set the hair render mode to hair primitives on the shave globals.
If you would like to use the awesome pass rendering use the light shaders (p_SpotTK).

vg1
10-05-2009, 12:52 PM
Zerogee,

Thank you very much for the solution. Works like a charm.

Didn't realize it was that easy to attach p_HairTK to Shave.

Cheers! :beer:

Puppet|
10-05-2009, 01:55 PM
p_shader_replacer is used for Maya Fur and Maya Hair only, because it's not possible to override default shader in GUI.

vg1
10-05-2009, 03:02 PM
That's great to know. Makes sense now.


Thanks for the reply Pavel, and thank you for your hard work on these shaders. You are a great asset to the community indeed.

vg1
10-08-2009, 12:55 PM
If you would like to use the awesome pass rendering use the light shaders (p_SpotTK).

Does Ambient Occlusion work with built in pass system of MegaTKk_pass?

I have attached MegaTK_pass to dummy geo to setup the pass system. I have p_HairTK attached to Shave node. Seems like when I render, I get this pass for Ambient Occlusion.

http://www.huemanelement.com/v/ao.jpg

Here is my setup in Hypershade. I have p_spotTK attached to my spotlight.

http://www.huemanelement.com/v/ph1.jpg

Any ideas on what I am doing wrong. Does the AO pass work.

To Render, I am using Rasterizer with Detail Shadow Maps. I don't have raytracing turned on. Must Raytracing be on in order to spit out the AO pass from MegaTK_pass (Although I have tried rendering with Raytracing and still get same result? Shave settings I am using primatives with Mental Ray. Is there a setting I am missing in order to get AO pass working?

Thanks in advance.

Puppet|
10-08-2009, 01:42 PM
p_HairTK have no build-in occlusion. You should connect any occlusion shader you want (to "Custom Occlusion" slot).

vg1
10-08-2009, 01:58 PM
Ok, great to know...Thank's Pavel.

vg1
10-08-2009, 02:47 PM
Sorry to bother you again Pavel...but here is an update on my progress.

I connected an Ambient Occ node to the custom slot of p_HairTK. I am still getting what seems like a blown out Occlusion as you can see in the pic. Any ideas on what may be the issue. Seems like I am starting to see some Occlusion perhaps on that image..a tiny bit but it is still blown out. When I view the image in Photoshop or After Effects it still looks the same, knowing that it is 32 bit image and all.

http://www.huemanelement.com/v/ph2.jpg

BTW, Here is AO pass after rendering with Rasterizer with turning Raytracing on. Occlusion starting to appear but very subtle. Have Spread set to .8 and Max distance to .1 in the mib_amb_occ node. I guess I'm getting somewhere. Still, Any other suggestions you may have would be great

http://www.huemanelement.com/v/ph3.png

Also, the alpha itself, is this normal..it looks like it renders with a straight alpha with jagged edges for certain passes like this one in particular. Other passes like diffuse, shadow and spec do render with alpha looking correct respecting transparency. Just curious.

JohnPetrucci
10-08-2009, 04:05 PM
does your fur have some incandencense or ambient color set to a high number?
maybe play a bit more with the max distance and spread. I got some okay results except from some small black dots on the tips.

Puppet|
10-08-2009, 06:36 PM
Occlusion effect to 4 component of p_HairTK shader: Diffuse, Specular, Ambient and Indirect.
You may control amount of effect for every component.

For all components default effect == 0.5. So I suppose you just need set "Effect Ambient" to 1.
Don't forget for Ambient Occlusion you should have "Ambient" enabled as well.
Incandencense or Lights should not effect to occlusion.

vg1
10-08-2009, 06:41 PM
Ok, thank you both,..im getting better results now. Here is render with mib_occ with spread set at higher setting. I turned the effect ambient and diffuse ambient up to 1 on p_HairTK node.

http://www.huemanelement.com/v/ao2.png

thanks.

JohnPetrucci
10-09-2009, 01:06 AM
Looking good!!

zerogee
10-09-2009, 08:47 AM
I used FG with a white IBL and it gave me somewhat better results than with old school occlusion.

Is there any way to bake this result into 4 textures based on the length of the hair like in Ratatouille?
see this post... (http://forums.cgsociety.org/showpost.php?p=5800256&postcount=35)

vg1
10-10-2009, 09:48 AM
It would definitely be interesting to find out if it is possible to bake occlusion result bases on length of hair. Perhaps Pavel may have some insight on how to do this or if it is currently even possible with his shader.

JohnPetrucci
10-12-2009, 08:13 PM
maybe with a ramp?

alibaba
11-24-2009, 10:23 AM
Please help me. How to connect to the p_HairTK the shave. shave on the link does not work p_shader_replacer. Thanks

alibaba
11-24-2009, 11:53 PM
Please help me.

vg1
11-25-2009, 03:08 AM
Alibaba,

The first part of this thread pretty much answers your question. As puppet himself says...

p_shader_replacer is used for Maya Fur and Maya Hair only, because it's not possible to override default shader in GUI.

Also, Zerogee explains how to assign pHairTK to Shave...

just assign the p_Hair to the actual shave node and uncheck the override geom shader on the shaveShape.
For advanced shadow tweaking place the p_HairTK_shadow to the shadow slot. Plus set the hair render mode to hair primitives on the shave globals.
If you would like to use the awesome pass rendering use the light shaders (p_SpotTK).

So, all you have to do is assign your pHairTK directly to Shave node. Treat pHairTK as a shader and just assign it to Shave node. Make sure to uncheck override Geometry shader.

Your scene that you included seems to have shader_replacer node with Shave but as Puppet said, shader_replacer node is meant to work for Maya Fur only since you cannot directly assign shader to maya fur.

Good luck

alibaba
11-26-2009, 05:28 AM
thanks vg1
Why do I render out of occlusion pass in this way. . why
Please help me. . Thanks


You can put your e-mail sent to me through the scene to learn about it?
my e-mail:carli0215@gmail.com

Occlusion rendering your hair look very hard. Can be built up into such an effect?
This example is mattrm fake occlusion
http://mattrm.blogs.3dvf.com/2009/09/18/pourquoi-un-fastsss-because/

alibaba
11-26-2009, 08:35 AM
Attached on the scene. Thanks again

raimZ
05-27-2010, 06:44 AM
I've been experimenting with the p_hair_with shave. It's great, and renders faster than the normal shader. But then i go and try to map a color texture to the root and tip attributes, but the diffuse color comes out really really dark. It doesn't look like the shader is reading the color texture at all. Am I making some noobish mistake?? I'm using standard maya file texture and a *jpg file. Any solutions?

vg1
05-28-2010, 01:21 PM
I'm not sure. I too am having some problems using color maps with p_hairTK. I seem to be losing a lot of detail when I plug color maps into the diffuse root and fiffuse tip of p_hairTK.

Here is a sample of what I am talking about.

http://www.huemanelement.com/v/shave.jpg http://www.huemanelement.com/v/p_hairTK.jpg

As you can see, the black line going down from the nose to the mouth area is almost lost when I use p_hairTK.

I am not sure what I am doing wrong.

Here are my settings:
rasterizer (rapid hair)
rasterizer quality samples 7
detailed shadow maps
2 spots (regular spots but also used p_spotTK to see if that made difference but did not)


I like what I get using only Shave but I would really like to use p_hairTK to take advantage of using the p_megaTK pass system for fur and need to resolve this problem to do so. Any ideas would be greatly appreciated.

agredbeard
05-28-2010, 04:08 PM
I haven't had any problems mapping color maps to the diffuse root and tip colors so far. The image looks like the tip isn't getting the texture. Try turning off all the other attrs like specular and ambient to see if the diffuse starts showing up better, or to see if the issue causing it becomes apparent. Just a thought.

The problem I'm having is with mapping a texture length wise along the length of each fur strand. As far as I can tell this can be done with the p_hair_mapping node. But I can't figure out how to set up the connections. Say I want to use a ramp with p_hair_mapping. How do I connect them to the p_HairTK node? Please help. Been trying web searches but I'm only finding vaugue posts to go off, and they're not helping. Thanks!

vg1
05-28-2010, 06:15 PM
agredbeard,

I believe you need to hook up p_hair_mapping outvalue to the U or V coords of your ramp. Then connect your ramp outcolor to the diffuse root and diffuse tip or p_hairTK.

Here is screen shot of my crappy setup of sphere and shave with p_hair_mapping and p_hairTK. Here, I just plugged the outvalue of p_hair_mapping into the V coord of the ramp. Then I plugged the outcolor or ramp into the diffuse and tip of p_hairTK.


http://www.huemanelement.com/v/sc.jpg


if you have a texture in your diffuse and tip already, you can plug the outvalue of ramp into the ambient slot of p_hairTK. That is what Pavel did in this post.

http://forums.cgsociety.org/showthread.php?t=786803

Hope this helps. If it does not, I will try to help you figure it out.

vg1
05-28-2010, 06:17 PM
Also, thanks for replying to my problem of colormaps not showing up properly with p_hairTK node. I tried unchecking everything like you said except for 'enable diffuse', but still no luck. Still looks the same.

Any other ideas would be greatly appreciated.

agredbeard
05-28-2010, 09:00 PM
Thanks vg1!!! :thumbsup: I HAD been trying to get it to show up in the Ambient ala that post by Puppet. But, it wouldn't work until I hooked it up to the diffuse root and tip. Maybe I missed something? But the effect in the diffuse works too.

I'll see if I can reproduce the problem you're getting with the texture in the diffuse root and tip.

Have you ever tried doing the same thing with p_hair_mapping but plugged into Transparency? I'm wondering if I can get a shape transparency-cut out of the hair "cards" (wide tip and root width). I'm Trying to make some Feather-like fur. Working on maya fur here at work. Will probably try feathers with Shave instancing too at some point when i get home.

agredbeard
05-28-2010, 09:16 PM
In my tests the texture file node Filter Type of Mipmap, or the default Quadratic, had a really big impact on the appearance of my texture in the diffuse root and tip of p_hairTK. Blurred it out completely in the front. Switch the filter type to Off, and that seems to clear it up a lot. Let me know if that helped.

vg1
05-29-2010, 02:57 AM
In my tests the texture file node Filter Type of Mipmap, or the default Quadratic, had a really big impact on the appearance of my texture in the diffuse root and tip of p_hairTK. Blurred it out completely in the front. Switch the filter type to Off, and that seems to clear it up a lot. Let me know if that helped.

I will definitely try this. My working file is at work and I will try this when I get back to work Tuesday.
Meanwhile, I will try to recreate something to test it here at home.

I will let you know the results

Glad to here that the p_hair_mapping problem is sort of working out for you.

Have you ever tried doing the same thing with p_hair_mapping but plugged into Transparency? I'm wondering if I can get a shape transparency-cut out of the hair "cards" (wide tip and root width). I'm Trying to make some Feather-like fur.

I have not tried this. Would be very interesting if it worked. If I find out anything about this I will let you know.

vg1
05-31-2010, 12:57 AM
Hey Andrew,

Your recommendation of switching the texture filter type to 'off' worked. :thumbsup:

I don't understand why the filter type has to be changed from quadratic to off but it worked.

Thanks mate, cheers :beer:

zerogee
06-01-2010, 08:37 AM
Or try mipmap with effects/filter=0.3 in this way you still get sharp textures without any filtering problem. Sometimes you need to use elliptical filtering but not with fur...

yuttanaaa
02-09-2011, 09:05 AM
thank for tip!

CHERNABOG
03-16-2011, 12:27 AM
Hi guys, Iīm having trouble with the p_hairtk shader, the hair is rendering in black and white and not in color, checking and unchecking the Override Geom shader makes the hair disappear in the rendered image, so I canīt go back and forth with it, but the biggest issue is with the hair color, Iīm using Maya 2011 x64, and the v3.3 of the p_shaders thanks in advance for the help!

http://i1094.photobucket.com/albums/i441/gerardovalerio/test_hair_01.jpg

agredbeard
03-16-2011, 09:33 PM
It's hard to say exactly what's going on there, but I would just take a look at the directions on these two blog posts on djx's blog:

http://www.djx.com.au/blog/2009/04/14/p_hairtk-p_hairtk_shadow-p_shader_replacer/
http://www.djx.com.au/blog/2009/11/03/p_hairtk-with-p_shader_replacer-update/

This issue may be as simple as renaming the object that has the geometry shader/shader replacer plugged into it with a prefix of "AAA_". But without the scene file, or screenshots of the nodes, it's kind of hard to say for sure...

hope this helps... :D

EDIT: oops, I didn't realize you were using Shave?!! Ok, still hard to say for sure. But I know the method is supposed to go: Select shave hair, assign p_HairTK to it (like you would a regular lambert material - i.e. right click assign new material), uncheck the override geom shader on the shaveShape, and set the hair render mode to "hair primitives" on the shave globals.

CHERNABOG
03-22-2011, 12:14 AM
Hey Andy, thanks for replying man, yeah I already did all that, but Iīm having the same results, donīt know what could be. :shrug: I manage to get some renders with 3delight since I was not happy with the mental ray result , but the specular control with the shave shader is a little clumsy, thatīs why I was trying p_hairTk with mental ray. :hmm:

CGTalk Moderation
03-22-2011, 12:14 AM
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.