Updating Uniform Buffer Data in WebGL 2?
问题 Different from OpenGL ES 3, without gl.mapBufferRange and gl.bufferSubData (It exists), what is the efficient way to update uniform buffer data in WebGL 2? For example, a PerDraw Uniform block uniform PerDraw { mat4 P; mat4 MV; mat3 MNormal; } u_perDraw; 回答1: gl.bufferSubData exists so it would seem like you create a buffer then create a parallel typedArray. Update the typedArray and call gl.bufferSubData to copy it into the buffer to do the update and gl.bindBufferRange to use it. That's