Cesium原理篇:6 Render模块(6: Instance实例化)【转】
https://www.cnblogs.com/fuckgiser/p/6027520.html 最近研究Cesium的实例化,尽管该技术需要在WebGL2.0,也就是OpenGL ES3.0才支持。调试源码的时候眼前一亮,发现VAO和glDrawBuffers都不是WebGL1.0的标准函数,都是扩展功能,看来WebGL2.0标准的推广势在必行啊。同时发现,通过ANGLE_instanced_arrays的扩展,也可以在WebGL1.0下实现实例化,创建实例化方法的代码如下: var glDrawElementsInstanced; var glDrawArraysInstanced; var glVertexAttribDivisor; var instancedArrays; // WebGL2.0标准直接提供了实例化接口 if (webgl2) { glDrawElementsInstanced = function(mode, count, type, offset, instanceCount) { gl.drawElementsInstanced(mode, count, type, offset, instanceCount); }; glDrawArraysInstanced = function(mode, first, count, instanceCount