'w' parameter of SV_POSITION

In vert shader we’re doing the following:

o.pos = mul (UNITY_MATRIX_MVP, v.vertex);

What’s the value of o.pos.w? It seems to me that it has something to do with vertex-to-camera distance.
Am I correct?
Will it be efficient to do lod-transition based on o.pos.w instead of ddx ddy as in here?

inline fixed GetLodLevel(half2 _uv) {
    fixed2 dx = ddx( _uv * 512.0 );	//Multiply by texture size
    fixed2 dy = ddy( _uv * 512.0 );
    fixed d = max( dot( dx, dx ), dot( dy, dy ) ) * 10.0;
    return d;
}

Thank you!

Kind of, it’s the (negative) z coordinate in view coordinates, i.e. the distance from the camera to the projection of the vertex onto the view direction. See, for example, http://en.wikibooks.org/wiki/GLSL_Programming/Vertex_Transformations#Projection_Transformation_and_Perspective_Division (in OpenGL the last row of the projection matrix is usually (0, 0, -1, 0) which means that w is set to -z)

For that to work, you would also have to know how fast texture coordinates are changing in object coordinates, i.e. you would have to pre-compute this somehow and communicate it with an additional set of texture coordinates. Furthermore, you have to take the model-view matrix into account. Thus, I think in the end it will be more expensive to compute (except maybe for special cases) and always much more difficult to implement.