Texture buffer objects or regular textures?

OpenGL SuperBible discusses texture buffer objects, which are textures formed from data inside VBOs. There seem to be advantages to using them, but all the examples I found create regular textures. Does anyone have any tips on when to use one over the other?

+7
source share
2 answers

According to the registry extension , texture buffers are only one-dimensional, cannot filter, and should be accessible by accessing explicit texels (by index), instead of the normalized [0,1] floating-point texture coordinates. Thus, they are not a substitution for regular textures, but for large homogeneous arrays (for example, skinning matrices or instance data). It would be much more reasonable to compare them with uniform buffers than with ordinary textures, for example, here .

EDIT: If you want to use VBO data for regular, filtered, 2D textures, you will not be able to bypass a copy of the data (best done using PBO). But when you just want access to VBO data for easy access to the array not enough for this, then a method should be selected with the texture buffer.

EDIT:. After checking the relevant chapter in SuperBible, I found that they, on the one hand, mention that texture buffers are always one-dimensional and accessible using texel discrete integer offsets, but on the other hand does not explicitly mention the lack of filtering. It seems to me that they more or less advertise them, because textures simply select their data from buffers, which explains the OP issue. But, as mentioned above, this is simply a wrong comparison. Texture buffers simply provide a way to directly access the buffer data in the shaders as a simple array (albeit with a custom element type), no more (which makes them useless for regular texturing), but no less (they are still a great feature) .

+8
source

Regular textures are used when VBOs are not supported.

0
source

All Articles