particle color by distance

General discussion about Cycles 4D.
Post Reply
max1e
Posts: 1
Joined: Wed May 02, 2018 12:10 pm

particle color by distance

Post by max1e » Wed May 02, 2018 12:16 pm

how to render this (see image) in cycles 4D? any cycles node have distance to camera parameter?
thanks
distance.jpg
distance.jpg (89.21 KiB) Viewed 194 times

User avatar
Mohamed Sakr
Posts: 595
Joined: Tue Nov 15, 2016 8:45 am

Re: particle color by distance

Post by Mohamed Sakr » Sat May 05, 2018 7:12 am

max1e wrote:
Wed May 02, 2018 12:16 pm
how to render this (see image) in cycles 4D? any cycles node have distance to camera parameter?
thanks
distance.jpg
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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest