Gradient over multiple object?

Hi All,
How can apply a gradient shader across multiple objects?
For example say I had 3 different objects and a gradient texture which has a red colour point on the left side and a yellow colour point on the right side.
How apply the gradient across all three objects with the first object receiving the red of the gradient and the last object receiving the yellow of the gradient.
I would like to be able to adjust the colour points positions in the gradient and the result be displayed on the object?
My brain won’t work!!

Cheers
A

You can do this easily with “Input->Geometry->Position”

This node outputs coordinates of the absolute position of the object in 3D space, so once you rotate the three objects, they will rotate “through” the gradient, and not rotate the gradient with them. But as long as it’s just for one Frame/still image, you’re fine.

If you have to animate, you could bake the textures or probably link the rotation of the mapping node to the rotation of the objects with a driver, but i don’t know how that works really. Maybe someone does? :wink:

gradient.blend (819.3 KB)

you can get a little more control like this.

I parented/linked the gradient to the empty so i can use the empty to rotate the gradient. But if individual elements move in the gradient direction, they will still change colour of course. I don’t know if that’s a thing you need.

hope i could help, happy blending!

That’s great thank you very much

1 Like