Search code examples
openglgraphicstextures

Is there any benefit to 1D vs. 2D textures?


Is there benefit (speed, memory, etc.) to using a 1D texture vs. using a 2D texture in OpenGL (or any other graphics library). I realize I will only be have to address the texture using 1 coordinate instead of 2 but I'm wondering if there is any kind of speed or memory benefit?


Solution

  • I was looking for the info listed under the "Edit" of this question: Are 1D Textures Supported in WebGL yet?

    1D textures are not moot, they exist because they not only have a purpose, but are intended to translate into optimizations on the GPU itself (as opposed to a 2D texture). Remember that each parameter takes time to load onto the call stack, and almost all GPU programming is an art of optimizing every possible operation.

    Whether or not that would actually improve the performance of any application is still something that would need to be profiled. Regardless, I'm writing library code and that is enough for me to make the decision that I should support using 1D textures.