At least I think what I need is clip space. Perhaps called view-space? Not sure. The space that represents the entire camera frustum in a box ranging from -1 to 1 for all x,y,z coordinates.
So for each vertex that is rendered, would need to transform its coords into that clip (or view?) space as described above (or proportionally outside, if vertex falls outside the view frustum).
I first suspected it’s simply the standard mul(UNITY_MATRIX_MVP, v.vertex) but outputting this vec3 to a rendertexture (after remapping to [0…1]) I’m now pretty sure this isn’t it.
Actually I only render out.rgb = pos.zzz and I expect a gray gradient with the near and far planes at the extremes of pitch-black and bright white. But with UNITY_MATRIX_MVP everything is equally white and stuff that gets clipped at the near plane is only a very light gray, not pitch black. So this matrix is not doing what I hoped it would.
Which matrix gives me clip-space coords? I don’t need world space and I don’t need model space, both are easy but useless here…