What I’m trying to achieve is a displacement pass that isn’t too intense for objects in the foreground; A normal pass does this 'cause it uses tangent space, but it’s useless unless you work with something that can interpret normals and all I can use is gray scale maps.
Is there a way to convert a normal pass to a shallow displacement using nodes? I am sure you can do something by separating RGB, then math nodes, then re-combining that but I can’t seem to make it work in a coherent way.
Or is there a special node or pass that I am overlooking?
Alright, due to the lack of responses I assume it’s either impossible or no one will ever use this, but, if you are one of the very few weirdos that might need a solution for this problem, I’ve found that a tweaked fresnel pass could do the trick. It’s not perfect, it won’t work with certain geometries, such as cubes, which is what I needed it for, but it’ll work for round-ish or spherical topologies. I tried every single node setup I could on this and nothing worked, as far as I know, you cannot convert normals back to height. It’s a one-way street.
If you find a solution, I would like to hear it. I solved the problem with fresnel, but I’m still curious.
Still not 100% sure what you are trying to achieve but z-pass objects per object can be done with the new AOV-output in Blender 2.82. Well, you could do it before but now it is more convenient.
In the following setup the distance from camera to object is measured. Based on this distance a brigtness is assigned to the whole object.
After that the z-Depth is multiplied onto the object.
All of this is output into an AOV-Ouput so you get a separate pass later on and can render you object with your regular shader.
In the example the emission shader uses the same input as the AOV-output for visualisation reasons but you could also make the emission shader something else.
Anyway, in the viewport you can see three different cubes with three different depth passes. As you can see by reference to the orange dots, the objects with closer origins have darker depth gradients.