how to render this (see image) in cycles 4D? any cycles node have distance to camera parameter?

thanks

## particle color by distance

- Mohamed Sakr
**Posts:**595**Joined:**Tue Nov 15, 2016 8:45 am

### Re: particle color by distance

yes

here are the nodes in order (sorry about no image):

1- input->light path node , you will need Is Camera Ray and Ray Length

2- converter->math multiply, you will take the above 2 sockets, as input 1 and 2, multiply.

3- another math node, set it to maximum, first value from the previous math node, second value is your minimum (0 in that case)

4- another math node, set it to minimum, first value from the previous math node, second value is your minimum (10000 in that case)

5- another math node, set it to divide, first value from the previous math node, second value is your minimum (10000 in that case)

6- now your values are from 0 to 1, connect this to a Color Ramp node, and it should work as expected.

### Who is online

Users browsing this forum: No registered users and 1 guest