Using Textures for Generic Data Storage
It is possible to use the memory representing a buffer object or a single level of a texture object for general purpose read and write access in shaders. To support this, the OpenGL Shading Language provides several image types to represent raw image data.
Images are declared in shaders as uniforms in a similar manner to samplers. Just like samplers, they are assigned locations by the shader compiler that can be passed to glUniform1i() to specify the image unit which they represent. The OpenGL Shading Language image types are shown in Table 11.1.
Notice that most ...