Textures are not just for pictures
In the previous chapters, we used two different methods to upload larger amounts of arbitrary data to the GPU: in Chapter 4, we added uniform buffers, and in Chapter 9, shader storage buffers were introduced. The push constants for Vulkan are not added to this list because of the limited size of only 128 bytes.
Uniform buffer objects, abbreviated to UBOs, were introduced in OpenGL 3.1. UBOs can contain data shared across all shaders, ideal for uploading central data such as matrices or light parameters. But alas, the minimum guaranteed size of uniform buffers is only 64 KB, a limit one could reach quickly on complex virtual scenes.
Also introduced in OpenGL 3.1 were texture buffer objects, or for short, TBOs. Technically, a TBO is closely related to a texture, but it is not backed by an image like a real texture. Instead, a separate buffer is bound to the texture unit, and every texel of that texture can be read by its position. The value is...