View Full Version : 3d gradient texture

07-12-2004, 08:36 PM
I don't know how explain so example:
if object is sphere, than i want to made 3d texture of object that is black until inside point is less than 0.5 of radius and white when point is between 0.5 and 1 of radius.
How can be done such texture for sphere and more complicated objects?

07-13-2004, 04:36 AM
You can use the distanceBetween node to calculate the relationships between your 'inside & outside' distances. OR
You can use the closestPointOnSurface node to reference a 'hidden' 2nd model as the input surface for the calulation of that node (worldSpace>inputSurface). (For complex models) OR
You can use the condition node to take an input of the sphere's radius as the driver.
I'm presuming you are not talking about volumetic textures here.:D

07-13-2004, 04:39 AM
You could take the point obj X, Y, and Z from a sampler info node, add them together in a plusminusaverage node, use muliplydivide to scale it down to the 0-1 scale, and then use that as the U coord input for a ramp texture. (Sometimes effects similar to what you describe could be done within a volume light instead of using special shaders, though...)


07-13-2004, 07:17 AM
Thank you, guys! :thumbsup: All tips are helpful.
I mean volumetric texture inside the object for parti_volume shader.
closestPointOnSurface is great!

07-14-2004, 06:10 AM
Guys, is there anywhere closestPointOnMesh for maya 6? I have recently downloaded bonus tools for maya 6 and there are no closestPointOnMesh. :(

CGTalk Moderation
01-18-2006, 04:00 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.