The one material graph I’ve seen recently is this:
Someone shared it on slack.
Check this post too:
In both cases you need to find camera vector, which start at the camera origin and passes throw the middle of each texel/pixel. To calculate it you can find camera vectors in the corners of the texture and then interpolate them for each pixel using screen space coordinates. Can’t tell you how to calculate it right now, I think you could use Phytagoras’ theorem for this as you know camera angle (FOV), it should be 90 degrees for cubemaps and as you need only direction you can choose any distance from the camera as lenght of adjacent side of the triangle. Just don’t forget to conver angle to radians.