I want to animate a gradient node moving around from left to right, but I cannot figure out how to. I tried the Color Ramp and the Mapping node to control the gradient spline.

This is the node setup I have at this point Node setup gradient


You can key-frame the location field(s) in the Mapping node.

At the moment you are mapping in Camera space, (i.e. the space of the whole rendered screen in XY, and Z in and out of it.) Maybe one of the spaces associated with your object would suit your purposes better, it depends what you want to do.

Select 'Texture' in the Mapping node, and right-click in any of the Location fields to set keyframes, and animate the position of the texture in X/Y/Z.

Frame 5:

Frame 5

Frame 40:

Frame 40


Just add the sine of time to it, the time can be computed using Animation Nodes and passed to Cycles as follows:

Node Tree

  • $\begingroup$ Personally, I think the description of this (perfectly good) solution needs fleshing out. There's no guarantee the OP or less experienced readers will know anything about Animation Nodes, or even that you are using them? $\endgroup$ – Robin Betts Sep 20 '18 at 13:09
  • $\begingroup$ @RobinBetts You are right. I will add another method using drivers. $\endgroup$ – Omar Emara Sep 20 '18 at 13:33
  • 1
    $\begingroup$ It seems I don't know how to use drivers. I will let a more experienced user add a driver approach in another answer. $\endgroup$ – Omar Emara Sep 20 '18 at 13:45
  • 2
    $\begingroup$ I thought your AN approach was fine - I just thought you could make it clear you were using them. (not everyone knows what they are, or what they look like.) If @jspr comes back wanting automation, we can cross that bridge when we get there :) $\endgroup$ – Robin Betts Sep 20 '18 at 14:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.