In OpenGL ES, can multiple programs have the same VBO used and bound to their attributes?

330 views Asked by At

I have two programs which I am switching between. I loaded my position data up in a VBO and then set up my vertex attribute arrays for my first program. When I switch to the second program and attempt to set up my vertex attribute arrays using the same data, it fails to draw. If I make a second buffer using the exact same code however, and I use it for the second program, they both draw fine. I was wondering if someone might clarify the rules of sharing these VBO's between programs as I'd rather not have two buffers unless they are needed.

1

There are 1 answers

0
David On

Yes, multiple programs can be bound to the same VBO with no problem. My issue ended up being with another part of my program loading a separate VBO which was missing some of the vertices and had nothing to do with the use of two programs.