仅修改特定元素类型的VBO缓冲区数据? [英] Modifying only a specific element type of VBO buffer data?
问题描述
现在,我有我的VBO使用单缓冲器,它有顶点,texcoord和颜色的元素。
现在,可以有效地只更新texcoords没有更新顶点/颜色?
您可以将VBO的特定范围映射到用户内存中 glMapBufferRange 。当然,如果顶点,颜色和texcoord数据是交错的,它将等效于 如果您的VBO是: 您只能通过映射缓冲区的最后部分( 但如果您使用交错数据: 那么你不能更新缓冲区的一部分。 I have my VBO using single buffer at the moment, it has vertex, texcoord and color elements. Now, is it possible to update efficiently only the texcoords without updating the vertex/color as well? It should be the same efficiency as having separate buffers updated. You can map a specific range of your VBO into user memory using glMapBufferRange. Of course, if your vertex, color and texcoord data are interleaved, it will be equivalent to a glMapBuffer. EDIT: If your VBO is: You can upload only the texture coordinates by mapping the last part of the buffer ( But if you use interleaved data: Then you cannot update part of the buffer. 这篇关于仅修改特定元素类型的VBO缓冲区数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
[XYZ XYZ XYZ XYZ RGBA RGBA RGBA RGBA TxTy TxTy TxTy TxTy]
[TxTy TxTy TxTy TxTy]
)来上传纹理坐标更新它。您也可以使用 glBufferSubData 执行此操作。
[XYZ RGBA TxTy XYZ RGBA TxTy XYZ RGBA TxTy XYZ RGBA TxTy]
[XYZ XYZ XYZ XYZ RGBA RGBA RGBA RGBA TxTy TxTy TxTy TxTy]
[TxTy TxTy TxTy TxTy]
) and update it. You can also use glBufferSubData to do that. It would be faster to update that buffer than the full one.[XYZ RGBA TxTy XYZ RGBA TxTy XYZ RGBA TxTy XYZ RGBA TxTy]