Hi all,
Yes, use the pointCameraZ (from samplerInfo) to modify the color / shader with the distance.
For a fog fake, create a samplerInfo, a setRange, 2 surfaceShader (the 1st is the assigned mat. to the object and the 2nd is the fog's color) and a blendColor.
Connect the pointCamZ to the inputZ of the setRange, connect the outputZ of the setRange to the blendColor.blender.
Plug the output of the blendColor to the 1st surfaceShader, and finally connect the outColor of the 2 shaders (2nd surfaceShader and your material) to the color1 and 2 of the blendColor.
When you have your network done, assign the first surfaceShader to your object.
You'll have then to clamp the resulted distance in the setRange (minZ 0 maxZ 1) and the oldMinZ is the nearest distance from the cam, and oldMaxZ is the farthest distance (because the axis of the pov through the cam is -Z)
Adjust the oldMinZ and oldMaxZ to see your object being faded as it gets closer or farther from the cam.
You can refine your fog's surfaceShader by mapping it with a 3d fractal or whatever 3d 'turbulence' texture...
Good luck
Emmanuel
Emmanuel Campin
Lighting & shading TD
www.pixho.com