1
$\begingroup$

i want to show some textures when the camera is closer to the object and not when it is far, so how can i do this in cycles. is there any particular node to do this trickery or any work around?

$\endgroup$
1
$\begingroup$

You can use the camera data node to control the mixture of two nodes (color mix or shader mix).

Mix nodes expect information on the 0 to 1 scale, so the distance information will need to be scaled somehow or you need to define a threshold for the transition.

As an example: With a math node in "Less Than" or "More Than" mode you can create a distance threshold for the transition.

enter image description here

For a more subtle transition you can use a gradient texture:

Notice that you can usel Z depth as well and use a multiply node to control the transition point.

enter image description here

And for more control a color ramp.

enter image description here

For more info read : Using the Camera Data Node

$\endgroup$
  • $\begingroup$ yeah exactly what i was looking for $\endgroup$ – Ashok Jun 20 '18 at 5:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.