Timeline for OpenGL concatenate vertex data into one big VBO
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 15, 2020 at 21:15 | vote | accept | Schrödinger's cat | ||
Jan 15, 2020 at 21:15 | answer | added | Schrödinger's cat | timeline score: 0 | |
Jun 28, 2019 at 20:42 | comment | added | Schrödinger's cat | Mh I see, then I have to use two VBOs for loading one 3D model. One for the vertices and another for the texture coordinates | |
Jun 28, 2019 at 20:30 | comment | added | Ocelot | Well then you can't pack more than 4 floats per vertex attribute in one VBO. Specification says that glVertexAttribPointer() parameter "size" must be in range [1; 4] which corresponds to the types from float to vec4 in your shader program. You can, at best, pack 2D position and UV coordinates which will be two 2D vectors packed in one 4D vector. Specification page for glVertexAttribPointer() : khronos.org/registry/OpenGL-Refpages/gl4/html/… | |
Jun 28, 2019 at 20:20 | comment | added | Schrödinger's cat | I want to pack multiple vertex attributes into one VBO | |
Jun 28, 2019 at 19:11 | comment | added | Ocelot | Wait... Do you want to pack multiple vertex attributes into one VBO or you want to concatenate multiple vertex arrays into one? | |
Jun 28, 2019 at 11:35 | comment | added | Schrödinger's cat | @Ocelot That sounds promising, can you please put it in an answer so I can accept it? Also, can you please explain how to use adjust glEnableVertexAttribArray() and glVertexAttribPointer() in this particular case? | |
Jun 27, 2019 at 18:40 | history | edited | Pikalek | CC BY-SA 4.0 |
added 6 characters in body
|
Jun 27, 2019 at 18:10 | comment | added | Ocelot |
For vertex arrays, simply concatenate them as is, but for indices you will need to add offset for new consequitive stream of index data. That is, for each index of the new index array you add current size of the concatenated array. index = index + concatenated_ib_size;
|
|
Jun 27, 2019 at 18:03 | history | edited | Schrödinger's cat | CC BY-SA 4.0 |
added 4 characters in body
|
Jun 27, 2019 at 17:55 | review | First posts | |||
Jul 11, 2019 at 17:55 | |||||
Jun 27, 2019 at 17:50 | history | asked | Schrödinger's cat | CC BY-SA 4.0 |