1) Context I'm using a regular OpenGL perspective projection matrix created with GLM (glm::perspective) and taking the inverse (glm::inverse) to transform clip-space back into view space (and world space ultimately). Now with z-values at the near and far plane it's easy to choose the x,y,z,w components of the clip-space cube corners and get the world space point of the frustum volume.
2) Question Now, I want to harness the fact that clip space is a cube and generate a grid over the frustum. for x,y this works with the regular inverse projection matrix. For z, if I take uniform subdivisions of the range [-1.0, 1.0] with w=1.0, the view space z values will not be linear. I haven't got enough sleep recently to convince myself to do the math. What would be an inverse projection matrix to do this?