Jump to content
Sign in to follow this  
3__

Tube_from_curve?

Recommended Posts

Hi all, just a simple question:

how to render a curve as a tapered tube,

without renderman, vex-hair shaders or

polywire... I just need a simple tube

from a nurbs curve (tapered with a point

attribute), to which I can apply any shader.

thanks!

-cpb

Share this post


Link to post
Share on other sites

Does it need to be a real tube? I mean do you need to see an open end? If not you can add a width point attribute to the curve to taper it ( making it a ribbon) and fake the appearance of a tube by manipulating the color over the width (s) of the ribbon.

This example sets $PT*0.2 as a width attribute and has s converted to a vector feeding into the shader color output. You could use P and/or N and probably get better results and make it take your scene lights into account....

If you need a real tube... I don't know I guess a procedural DSO is probably the answer.

post-257-1142654026_thumb.jpg

Share this post


Link to post
Share on other sites

Hey cpb, here's an example using the Sweep SOP. Basically using the point function in the sweep to grab the curve's per-point attrib.

-Edit: If this is for a hair solution or something with lots and lots of curves then this is not efficient of course.

tube.zip

Share this post


Link to post
Share on other sites

I think you can look into the Hair VOP shader to see how they render a curve to look somewhat like tube. I won't be looking as nice as a full-blown hair shader tho. But I think it should meet some very basic needs.

Share this post


Link to post
Share on other sites

thanks all. a modified hair shader will do for

volume, sweep for close-up... although point()

seems a bit fussy, will try to isolate an example

later.

-cpb

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×