Jump to content

changing P lookup inside shader


Recommended Posts

Hi guys,

 

I've been trying to put together a fake-peach-fuzz shader. I'm mostly after the way peach fuzz gets backlit, with the light wrapping around the surface. But i'm banging my head against the wall (and my desk, and my keyboard) with it. Has anyone ever tried this?

 

The idea I've got is that if I look up the lighting/shadowing info for a point raised slightly above the surface (P + N*dist) then I should get some nice peach fuzz effect as the light would reach areas around the edges of the surface it couldn't usually reach. I've attached a sketch to explain this a bit better.

 

post-10649-0-19134100-1416809126_thumb.j

 

it should work in theory but I can't for the life of me figure out how to apply a shader to a theoretical point above the surface. I thought this would be as simple as changing the P attribute inside the shader, but that doesn't do anything. too obvious maybe :P

 

 

I've tried doing this as a two-step process, manually creating points floating above the surface and baking them to a .pc using pcwrite inside the shader, then transferring that color back to the points in SOPs. that's a lot easier but I'd love to get this working in a single shader for learning's sake. the help file unfortunately is rather quiet on the subject.

 

I'd be grateful if anyone has got any suggestions.

 

thanks

Nils

Link to comment
Share on other sites

Mantra does only allow editing of the P attribute inside of the displacement shader context. You cannot change this in a surface shader context.

The only way to get the additional lighting information would be to use the trace / gather to sample the lighting information yourself.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...