I've been trying to recreate the clip space coordinate system in Blender's shader nodes. From what I know, the only coordinate systems you have access to are object coordinates (position), world coordinates (via vector transform node), and window (?) space coordinates (which the vector transform node calls "camera")
Basically, what I'm trying to do is transform a point from a 3d space onto a 2d projection, but using an actual Blender camera object rather than the screen/window. No real reason other than out of curiosity and interest
Blender doesn't have matrix data support yet (though it's coming eventually, albeit only in geometry nodes) so I had to make do with a pretty awkward node set up to replicate matrices and matrix operations. I'd like to think I'm almost there but this looks wrong and I don't really have anything to compare it to
I used drivers to get the camera parameters into shader nodes and used it to construct a model, view, and projection matrix (using this post: How can I get the camera's projection matrix?)
I have a simulated frustum visual for reference
I have a mockup here of what i was expecting clip space to look like, with the Z component (or Y as i mislabeled in the image) representing the depth and the XY coordinates being the 2d coordinates