How to set texture coords without duplicate vertex positions

Hello dear JGO!

I am having a bit of a issue with my Gui rendering system. Currently, i bind a texture for every “Gui” i render. However, i want to make it more efficient by using a texture atlas, by specifying different texture coordinates for every texture. However, my problem is that i have the same vbo (It just contains vertex position data for a quad) for all of the Guis, and i just scale that quad in the shaders. However, to get my texture coords to the shaders, i will have to create a separate vbo for every texture.

I thought of maybe using glBufferSubData to change the vbo’s texture coords, but that doesn’t seem vary efficient.
Do you have any ideas? Thanks vary much :wink:

Does your “Gui” mean a UI element?

Why a VBO for each “Gui” ?
You can push all “Gui” items in the same VBO. In this case you just have to bind your atlas texture and your vbo and call how many required drawElements… method (with appropriate index)

Yes, it does.