简体   繁体   中英

attaching a vertex buffer object to a vertex array object

I am trying to attach a vbo to a vao. However I only get it to work the "old" way:

bind vao
bind vbo
glVertexAttribPointer(...)
glEnableVertexArrayAttrib(...)
unbind vbo
unbind vao

Now I want it to implement the new bindless way, I tried it like this:

glVertexArrayAttribFormat(...);
glVertexArrayVertexBuffer(...);
glVertexArrayAttribBinding(...);

However then I only get a black screen.

Attaching the index buffer object to the vao works though:

glVertexArrayElementBuffer(...);

What am I missing?

Seems like I was missing

glEnableVertexArrayAttrib(...)

Thus, the correct replacement would be

glEnableVertexArrayAttrib(...);
glVertexArrayVertexBuffer(...);
glVertexArrayAttribFormat(...);
glVertexArrayAttribBinding(...);

And don't forget to set the stride in glVertexArrayVertexBuffer(...), it should not be 0!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM