mantra shader / gradient circular

   9847   8   2
User Avatar
Member
191 posts
Joined: Aug. 2008
Offline
I want to use a circular gradient in the mantra surface shader so that the base color will be fade out from inner to outer.

I think that I have to use the alpha channel but how can I achieve this?

Thanks
User Avatar
Member
192 posts
Joined: Nov. 2008
Offline
more than a few ways to do this but here's on i like the best:

make a null that's the ‘center’ of your ramp. check the ‘output transform as render space’ parameter on the null. this makes the null ostensibly the same as a ‘place 3d’ transformation node in maya.

transform your shading point into that space and take the length. you can then use this to drive a ramp parameter or whatever.

moving and scaling the null will change the position and size of your ramp.

good luck dude.

Attachments:
ramp.jpg (95.4 KB)

User Avatar
Member
191 posts
Joined: Aug. 2008
Offline
can you provide me a simple test scene?

as I noticed you connected it to a color but can I also connect it to the alpha so the surface “fades” with the background?

Thanks for your help
User Avatar
Member
191 posts
Joined: Aug. 2008
Offline
I've solved it
User Avatar
Member
192 posts
Joined: Nov. 2008
Offline
roughsporty
I've solved it

nice 1
User Avatar
Member
6 posts
Joined: June 2012
Offline
great trick!!
But how could I transfer that to a vopsop. To create a bulge deformer for example?
You need to translate from which space to what? Tried from UV space to the null space but without a success… ops:
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
That's because it's not a Surface Shader. SOPs don't support the various transform spaces available inside of displacement and surface shaders.

It couldn't be easier though and there are an infinite number of ways to do this in Houdini. Here are two common methods:

1. You can still use a Null Object to drive things. Object Merge the single point it in to the object that contains the VOP network, wire it in to the second input of your VOP SOP and do a simple subtract P from the second input point location and wire in to the same ramp.

2. Put down a Parameter VOP and set it as a point. Now you can keyframe animate the position with a bound handle and you don't even need a point. You can tie this parameter to whatever you want. In the example I tied this to a Sphere SOP where the radius is the radial region and the position is the location of the effect.


I rarely use a Ramp Parameter these days without preceding it with a Fit Range VOP or a Fit Range Clamped VOP. Promote the in min and max parameters and leave the out min and max at 0 and 1 respectively. This gives you control to map wildly fluctuating input ranges to 0-1 for sanity in to the Ramp Parameter. In the file attached I use the max range as the range of effect cut-off.

Attachments:
color_region_by_locator.hip (125.0 KB)

There's at least one school like the old school!
User Avatar
Member
696 posts
Joined: March 2009
Offline
I'm very fond of using the bbox VOP to automatically calculate the center, thus eliminating the need for locator input and/or scripting…
Lay down a Bbox, subtract max from min, divide by 2 and add to min: You got your center point. You can then add to a parameter vector if you intend to offset the center every now and then.

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
6 posts
Joined: June 2012
Offline
Thanks for your help Jeff, at home I´ll look at all that options.

Thanks a lot!!
  • Quick Links