2
$\begingroup$

I want to create the effect of current flowing through cables. I want the current to flow over several curves from the beginning to the end of the cable. I created a material with a mix shader and set the texture coordinates to object so that I can control the current flow with an empty. The problem is that I can't let the current flow from the beginning to the end of the cables, because apparently it's not (only) the location that matters, but the rotation of the Empty. Therefore, several parts of the cables are always illuminated and the flow does not run from the beginning to the end.

Screenshot Energy

$\endgroup$

2 Answers 2

2
$\begingroup$

If you want to use the empty object as driver of the material, the material should look like this:

enter image description here

  • Texture Coordinates: use the Object output, and select the empty object in the object selector. Make sure the empty is really close to the mesh you want to affect.
  • Gradient texture: set to Spherical
  • Color ramps: no need for two of them, one for coloring is enough. Tip: if you set the color selector to HSV, you can manually write down values >1, which allows you as in my example to have the yellow color stop to emit light at 10 strength while the orange is at 1. Allowing a more granular control of light emission.
  • Principled shader: use the gradient texture in its Alpha channel if you want transparency.

I still recommend using a curve for animating the empty as Chris said though, if you only need it to go somewhat linearly from start to end with nothing more complex. Just add a curve, shape it how you want the object to move, then add a Follow Path constraint on the empty object.

demo gif

$\endgroup$
3
  • $\begingroup$ +1 nice idea! did u animate the empty manually or did you use another "trick"? $\endgroup$
    – Chris
    Commented May 2 at 5:44
  • $\begingroup$ Thank you for your answer Chris. But I think L0Lock nailed it here. I think the empty is animated along the curve using a follow path constraint $\endgroup$
    – user123511
    Commented May 2 at 6:19
  • $\begingroup$ Correct, it's a follow path constraint. I also added a glare/fog glow in compositing for the looks :] $\endgroup$
    – Lauloque
    Commented May 2 at 13:04
2
$\begingroup$

assuming that you want to achieve this:

enter image description here

i would recommend using a curve, because then you can use the UV x value for the right value to animate along the curve.

Shader node tree:

enter image description here

Note: yes, you can use a mesh, but then you have to UV edit your mesh in that way, that it is a straight line along the curve from x = 0 to x = 1 in the UV editor - which i think is too much work if you can do it with a curve easily.

$\endgroup$

You must log in to answer this question.

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