Material Pixel depth and camera distance

Hi,

I have this simple test where if the distance from the camera is > 2000 the material is green otherwise it’s red, the color is either red or green no blending.
This is the material setup

It works as intended however in some instance where the distance is 2000 give or take you can get this. If I understand correctly the shading is applied per pixel, is there a way to apply the distance calculation once to all pixels ?
image

Thank you.

Try using the pivot-point or ObjectLocation nodes as your basis for calculating distance so you get a single point of reference for the object, one that’s the same for all pixels.

1 Like

I appreciate the help.

No worries! Not a pro, but glad I can assist anyone I can!

Keep up your good work and good luck in your project! :smiley:

1 Like