In
the fragment shader, cubemap textures are accessed using a
samplerCube.
3D
texture coordinates, [s, t, r]T are
used in conjunction with the
samplerCube.
Each
texture coordinate is interpreted as a direction vector from the centre of the
cube. The direction vector is normally
in world coordinates.
The
line defined by the vector and the centre of the cube is extended to intersect
one of the cube faces.
The
image that corresponds to that face is then accessed at the location of the
intersection.