October 2018
Intermediate to advanced
500 pages
12h 40m
English
As described in Chapter 2, Rendering, we can implement vertex array objects in WebGL 1 by using the OES_vertex_array_object extension. That being said, they are available by default in WebGL 2. This is an important feature that should always be used, since it significantly reduces rendering times. When not using vertex array objects, all attributes data is in a global WebGL state, which means that calling functions such as gl.vertexAttribPointer, gl.enableVertexAttribArray, and gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffer) manipulates the global state. This leads to performance loss, because before any draw call, we would need to set up all vertex attributes and set the ELEMENT_ARRAY_BUFFER where indexed data is being ...