![]() I know about using "client memory" pointers, can you do this in OpenGL ES 2.0 (to avoid the memcpy) or is that deprecated, should use vertex buffers exclusively? What is the correct command order for creating a dynamic vertex buffer whose elements will be completely updated on every frame?Ĭan the vertex buffer grow between frames? Or do I have to flush exactly the same size? So this question has a couple of parts regarding dynamic vbos in OpenGL ES 2.0: ![]() ![]() The white points were the initial data, and the red points are the result of subsequent calls to glBufferData ![]() Memcpy(vbo_buffer, &rawDynamicData, rawDynamicData.size()*sizeof(VertexType) ) GLvoid* vbo_buffer = glMapBufferOES(GL_ARRAY_BUFFER, GL_WRITE_ONLY_OES) On subsequent frames, I'm just calling again: // update the data GL_DYNAMIC_DRAW // I plan to update the data every frame RawDynamicData.size() * sizeof( VertexType ), ![]() GL_ARRAY_BUFFER, //Specifies the target buffer object. GlBindBuffer( GL_ARRAY_BUFFER, vb ) CHECK_GL nth flushes all seem to overwrite the same memory. When I update my vertex array on iOS in OpenGL 2.0, the original vertex data is staying on the screen - ie the 1st flush is persistent (the initial set of points I sent down to the GPU gets rendered every frame), but the 2nd, 3rd, 4th. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |