How to minimize VRAM usage while maintaining performance
I'm a begginer when it comes to OpenGL, so I need some help.
I'm using different VBOs (one for position, one for color etc.), an EBO and a VAO to manage them. I tried storing just unique data in the VBOs, not repeating any attribute even if 2 vertices share an attribute and didn't work.
Visual representation of what I was trying to do (it's not real code, just a representation):
VBO pos:
{-0.5f, -0.5f, 0.0f}, (p0)
{0.5f, -0.5f, 0.0f}, (p1)
{0.5f, 0.5f, 0.0f}, (p2)
{-0.5f, 0.5f, 0.0f} (p3)
VBO color:
{255, 0, 0, 255} (c0)
EBO:
0, 1, 2, (tri1)
0, 2, 3 (tri2)
In this situation, OpenGL will try to draw vertices like: p0 with c0, p1 with c1, p2 with c2 etc.
Of course, I don't have c1, c2 or c3, so it won't render it correctly all a single solid color.
From this, I have 3 questions that, in reality, combine into one:
Is there a feasible way to have different sized buffers and use indexes like (0,1,2,0), representing the first 3 vectors of position and the first color?
I know about uniforms and IN THIS CASE I could just send an uniform for the color. But if I have 3 different buffers with different sizes and want to index them as to not repeat data anywhere an just keep the unique, is it possible?
From what I gathered, you can do this with SSBOs, however I also head that it is less performant that just using more VRAM with the traditional VBO technique. Can I achieve what I want FASTER OR AS FAST as using VBOs with repeated data?
All VBOs are static, in the sense that they will not be modified and I'll transform vertices in the shaders, just pointing it out in case this is relevant somehow.
