5
$\begingroup$

I'm attempting to create an animation of an expanding gradient area on a simple beam.

I managed to do this with a single color as shown below by applying keyframes to a ColorRamp in the node editor.

enter image description here

enter image description here

However I wish to have the top plane of the beam have a red color that gradually turns blue when going near the bottom side of the beam as pictured below (rough draft made in photoshop below to illustrate what im after if my explanation was confusing).

enter image description here

Is there a simple way to do this in Blender 2.91? I have played around in the node editor for a while but can't come up with any solutions on my own.

Thanks in advance.

$\endgroup$
1
  • $\begingroup$ Do you want both effects at once, or just the top to bottom? $\endgroup$ Oct 6, 2021 at 17:08

2 Answers 2

6
$\begingroup$

You could do it this way: Create an Input > Texture Coordinate node, a Vector > Mapping node, a Converter > Serpate XYZ node, use a Color > MixRGB node to mix a red and blue gradient with a grey color, and use a b&w ColorRamp as a factor to create the horizontal gradient. To take Marty's comment into account, if you want the color borders to be sharp, use the Constant option instead of Linear in the ColorRamp.

enter image description here

$\endgroup$
4
$\begingroup$

If you want the edges of the red/blue to bleed into the gray area, use moonboots' approach, but if you want the edges to be sharp here's an alternative:

alternate version

In this version you animate the threshold value of the Greater Than math node. At 0, the beam is entirely red/blue. At .5 it is entirely whatever you put in Color2.

This approach can give you blurred edges if you replace the Greater Than node with a color ramp. In this case, animate the left handle of the color ramp for the width:

variation on original

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .