1
$\begingroup$

In this experiment, I am instancing some icospheres on points of a torus geometry. I then use a simulation zone to move them on the positive Y axis each frame.

My intentions are to change the colour of the instances as they progress further on the Y axis, but I cannot figure out how to do this. Currently they get set a value from the colour ramp.

I would like each instance to change colour based on the gradient in the colour ramp as they get further from the instance torus object. Is this possible?

Here you can see the particles being generated from a torus object, I am moving the geometry up and down so the instances get generated on the z axis to give them an interesting look.

3d view

This is the node setup I have created to achieve this

3d nodes

And here is the material where I am using the posY attribute that I stored in the node tree.

3d material

$\endgroup$

1 Answer 1

2
$\begingroup$

first of all, connect y here instead of z and use float, not vector, because you wanna save only one value, not three.

enter image description here

and in the shader:

enter image description here

use the fac instead of vector, because there is coming only one value (y).

The colorramp expects a value from 0 to 1 ...but the y value is much bigger, so we have to divide that value so that we see the desired result.

result:

enter image description here

$\endgroup$

You must log in to answer this question.

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