PDA

View Full Version : Color Blending Surface



ednachman
05-23-2009, 08:03 PM
I have created a capsule; cut off both ends; and now have a tube. I would like to surface the tube with red at one end blending into blue at the other end. I've tried to use the node editor and gradient but still can't get the effect I want. Any help is appreciated.

Captain Obvious
05-24-2009, 05:59 AM
Create a Gradient and set the input to whatever axis the tube is along. Set one key to red, one key to blue. Tweak their positions. Plug it into the Color of the surface. Piece of cake.

ednachman
05-24-2009, 07:54 AM
I am enclosing a screen shot. Is this what you meant? I still can't get the blend.

3DGFXStudios
05-24-2009, 08:30 AM
That does not work. You need to do it with nodes

dee
05-24-2009, 09:14 AM
No need for nodes, just change the Input Parameter. And you have to render it, it doesn't show up in OpenGL.

ednachman
05-24-2009, 10:41 AM
I can't get the blend to start at top and go to the bottom. It starts at the middle and radiates to both ends. What am I doing incorrectly?

dwburman
05-24-2009, 11:23 AM
Yeah, that's a bit weird. If the pivot point is on the ground, you'd expect the gradient to start on the ground. Did you move your pivot point in Layout? Does it render this way or is it just just an OpenGL bug?

You can move the pivot point. You can add null object and use Y Distance to Object. You could put a weight map on the object (100% on one end and 0% on the other end) and change the gradient input type to weight map. There are probably a few other ways to do this as well.

ednachman
05-24-2009, 12:09 PM
I went into Modeler and changed the pivot point. It was set in the middle. I changed it to the bottom and now alls well with the world. For right now. Thanks for the help.

ApacheDriver
05-24-2009, 02:58 PM
The best way I've found to do this sort of terxture is a weight map and a gradient or a UV texture - either one will let you move or rotate the object without changing the texture.

To Use a Wt Map:
then Select all the points on the capsule and set the weight to -100 (I use the info tool), then contract the selection and set the weight of the selected points to -90 and so on until you have a graduated weight map for the capsule and use it for the gradient texture wt map.
Just set the min and max on the gradient to -100 and 100 (you may have went higher or lower than 100 - just set the max number to whereever you ended up when graduating the wt map.)

Using this you can set an unlimited number of colors to blend to or just two like you want to use. You can also copy and paste it to other textures like the spec of trans or whatever.

Hope this is clear and useful.

Gene

dee
05-25-2009, 03:48 AM
To Use a Wt Map:
then Select all the points on the capsule and set the weight to -100 (I use the info tool), then contract the selection and set the weight of the selected points to -90 and so on until you have a graduated weight map for the capsule and use it for the gradient texture wt map.

Use Ken Nign's Weight Outward (http://www.lwplugindb.com/Plugin.aspx?id=3a576f67) plugin to simplify this process.

evolross
06-28-2010, 12:24 PM
Here's a question I've always had... if you setup a UV map and want to color it with something simple that could easily be created with a gradient layer/node, how do you apply that gradient through a UV map? Is there some kind of "Previous Layer" input setup to do this? I've always had to create image-based gradients in Photoshop when I want to do this.

Hopefully I've been missing something because this is easy to do in other packages.

Captain Obvious
06-28-2010, 04:49 PM
Does the spot info node have a UV output? That would make it easy enough.

dpont
06-29-2010, 12:13 AM
In Texture editor, Gradient could work with a B&W image
mapped in UVMap projection mode as "Previous Layer",
so limited by the image resolution,
yes a nodal setup is more appropriate,

85974

Denis.

Captain Obvious
06-29-2010, 02:37 AM
Ah, the UV node has a U and a V output. That makes sense. :)

Tobian
06-29-2010, 08:11 AM
Just as a note to Captain Obvious' original reply: The solution is simpler in the node editor because you can specify any value on the position of the gradient.. I.e. the tube goes from 1 > -1, so you could set that up in the gradient positions, you can't do this in the layers system, as it just goes from 0 > 1 (or greater) but never negative, so you would have to mess on with your point of origin.

evolross
06-29-2010, 11:10 AM
Thanks Denis. That's awesome. I feel a little stupid that I didn't figure that out on my own.

gerardstrada
07-01-2010, 04:30 PM
I can't get the blend to start at top and go to the bottom. It starts at the middle and radiates to both ends. What am I doing incorrectly?

The first key in the gradient represents the origin of our reference parameter. In the case of the pivot point, if it's in the middle of the object, the gradient will get spread from the center to the ends. In such a case, a better input parameter will be an axis of another object (commonly a null), or a distance to object gradient - which works in all axes. With this is possible to fake localized color bleeding effects produced by indirect bounces of light, or simple and very fast SSS effects. In this simple sample:

http://www.hdri3d.com/xtra/11estrada/images/SSSBALL.jpg

the null object (called sphere) is on the table:

http://www.hdri3d.com/xtra/11estrada/images/36.png

and a distance to object gradient has been set up in this way:

http://www.hdri3d.com/xtra/11estrada/images/37.png
(this could be set up in the node or layer system)

a graphical representation of this gradient in 3D space would be something like this:

http://www.hdri3d.com/xtra/11estrada/images/SSSBALLEXP.jpg

The first parameter would be the black null position, second parameter would be the orange circle and the third parameter would be the yellow circle. It would be great to really adjust them in 3D space :)

Btw, there's more info about the basics of these type of gradients here:

http://www.hdri3d.com/xtra/11estrada/gradients.htm



Gerardo