I want to mix 2 shaders in a way, that part of a mesh that is more far away from camera are using one of my shaders, and part of the mesh that is closer to my shaders is using another shader, with soft transition between them.
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It only takes a minute to sign up.Sign up to join this community
Set up the nodes as pictured below. Add Camera Data node (Add [Shift+A]-->Input-->Camera Data), then Math Node (Add-->Converter-->Math). Optionaly you may add the Color Ramp node (Add-->Converter-->Color Ramp).
With the Math Node set to Substract try to experiment with its value (the closer to the object camera is the lower value should be).
Use Color Ramp node to make the transition between colours/ textures soft or sharp.
Edit: For smoother transitions you can use other math nodes in combination. For instance put a logarithm node between the Camera Data Node and Subtract node. Change the color ramp to Cardinal and also change the direction of the ramp. Set the bottom value of the Logarithm to 15.0 and the bottom value of the Subtract to .250. Subtract becomes an offset of sorts.