PDA

View Full Version : Sample info/shader question


T-R
12-01-2005, 02:36 AM
Hello,

I was just wondering, I am playing around with a shader with the good ol sample info/ramp setup and am curious if I am able to acheive the same effect on a cylindrical surface when it is running into Z space. When the camera looks at the object so its length is running in the Y direction the ambient portion of the ramp stays nicely on the edges, but if I move the camera so its "ontop" of it it all falls apart. Just wondering if there is a way to have this effect if the camera is "on top" of the object. Please see attached pic.

Thank you.



http://img205.imageshack.us/img205/5660/shader3sb.jpg

LehaS
12-01-2005, 08:28 AM
I guess you need to use Bump node instead of Sampler Info since you need your tube to be shaded depending on the normal direction rather than facing ratio in this case....Bump node has a OutNormal attribute that you can use

LehaS
12-01-2005, 11:46 AM
Here is what i m talking about

http://i34.photobucket.com/albums/d147/leha_sokol/outNormal.jpg

T-R
12-01-2005, 10:13 PM
Ok I think I have this working. I have plugged the normal camera xyz into one of the ramps uv coord as you suggested and this seems to work out. Thanks for your help!

EDIT:
Actually im getting the same results as if I just had a ramp on it with 3 color values, with the top and bottom being one color and the middle being different. Perhaps you can go into more detail on how you set this up:blush:

LehaS
12-02-2005, 06:53 AM
Hey no problem man

Actually its totally the same setup as you mentioned with Sampler Info and Facing ratio...Just instead of Sampler Info you have to use Bump2d since Sampler Info doesnt output any Normal vector per shading point....hmm maybe at least i didnt find it :D

As i mentioned in the 1st post you have to connect Bump node`s OutNormal Z to your Ramp`s V coordinate and then Ramp`s outColor to your Material color slot

T-R
12-02-2005, 08:11 PM
As i mentioned in the 1st post you have to connect Bump node`s OutNormal Z to your Ramp`s V coordinate and then Ramp`s outColor to your Material color slot

Ahh thanks for the help.:thumbsup:

CGTalk Moderation
12-02-2005, 08:11 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.