4 ms·
Unfortunately dynamic buffer updates is one of the tricky parts to do right in OpenGL since you need to assume what the driver does under the hood, and the best
by flohofwoe 12y ago
Unfortunately dynamic buffer updates is one of the tricky parts to do right in OpenGL since you need to assume what the driver does under the hood, and the best technique depends on what GL version you're targeting, and what GL extensions are available.
I found this blog post very useful: http://hacksoflife.blogspot.de/2012/04/beyond-glmapbuffer.html http://hacksoflife.blogspot.de/2012/04/beyond-glmapbuffer.ht...
If you can afford to target bleeding edge OpenGL, the AZDO slides contain the current state of the art (there's a whole section about dynamic buffer updates somewhere in there): http://www.slideshare.net/CassEveritt/approaching-zero-driver-overhead?related=1 http://www.slideshare.net/CassEveritt/approaching-zero-drive...
On WebGL, the established tricks like buffer orphaning don't work, and direct mapping isn't available. It seems best to simply do a bufferSubData and not care about double buffering etc (https://groups.google.com/forum/#!searchin/webgl-dev-list/floooh/webgl-dev-list/vMNXSNRAg8M/lu1NkJ22J_YJ https://groups.google.com/forum/#!searchin/webgl-dev-list/fl...)