I want the specularity of my Earth model to turn off after a certain distance from the camera as, in reality, the sun's reflection from the water soon fades the further you get from it. I want this same affect to apply to my model. Are there ways of doing this?
1 Answer
With material nodes, you can use the Camera Data input to get the distance from the camera to the surface. Note that this number will be much higher than the 0-1 range you'd normally want for a color value, and the numbers get bigger the further the surface is from the camera, so you'll need to do some math to invert and scale this value to whatever works best for your scene.
See the image below for a sample setup in Blender Internal, but Cycles has the Camera Data node as well.
-
$\begingroup$ That's absolutely perfect! Exactly what I needed thanks, would you be able to help me out with my night lights texture problem? $\endgroup$– StewieCommented Mar 30, 2015 at 15:55