Is it possible to use a custom function instead of the projection matrix to for example not project a vertex on a plane but a sphere ?

It should return an X-/Y-/Z-value between 0 and 1 of course and whats about the W-value is it W = 1/Z ?

Thanks in advance