Cubemap textures are a mechanism provided by GPUs that allows us to develop several rendering techniques such as skyboxes, skylight illumination, dynamic reflection of the environment, etc. With them we can map the visible environment onto the 6 faces of a cube and later easily query this information from a shader program.
In GLSL, and more specificly in the fragment language, gl_FragCoord is an input variable that contains the window relative coordinate (x, y, z, 1/w) values for the fragment. The detailed description of its contents and how normalized device coordinates (NDC) can be obtained from it are explained in this post.
Sometimes we need to know, in a fragment program, a pixel’s position in eye space. We usually need this in postprocessing operations, where we will tipically send an eye-facing quad filling the whole screen, executing an specific fragment program along with information about the scene (usually textures that contain surface normals, depth, materials, etc) that has been previously rendered in a previous pass.
So, during this postprocessing step, each fragment belonging to this quad corresponds to a little area on the surface of the previously rendered scene, although by now we only know its position within the eye-facing quad being rendered.
The question is: Which was its exact position in the scene in eye space?