extension.drawElementsInstancedANGLE( mode, offsets[ i ].count, type, offsets[ i ].start * size, offsets[ i ].count, type, offsets[ i ].instances ); // Draw the instanced meshes
extension.drawElementsInstancedANGLE( mode, drawcall[ i ].count, type, drawcall[ i ].start * size, drawcall[ i ].count, type, drawcall[ i ].instances ); // Draw the instanced meshes
} else {
_gl.drawElements( mode, offsets[ i ].count, type, offsets[ i ].start * size );
_gl.drawElements( mode, drawcall[ i ].count, type, drawcall[ i ].start * size );
}
_infoRender.calls ++;
_infoRender.vertices += offsets[ i ].count; // not really true, here vertices can be shared
_infoRender.faces += offsets[ i ].count / 3;
_infoRender.vertices += drawcall[ i ].count; // not really true, here vertices can be shared
h=2),k=d.drawcalls,0===k.length){b&&(l(e,a,d,0),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,g));if(dinstanceofTHREE.InstancedBufferGeometry&&0<d.maxInstancedCount){varp=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}p.drawElementsInstancedANGLE(f,m.array.length,c,0,d.maxInstancedCount)}elses.drawElements(f,m.array.length,c,0);R.calls++;R.vertices+=
m.array.length;R.faces+=m.array.length/3}else{b=!0;for(varm=0,q=k.length;m<q;m++){p=k[m].index;b&&(l(e,a,d,p),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,g));if(dinstanceofTHREE.InstancedBufferGeometry&&0<k[m].instances){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}p.drawElementsInstancedANGLE(f,k[m].count,c,k[m].start*h,k[m].count,c,k[m].instances)}elses.drawElements(f,
k[m].count,c,k[m].start*h);R.calls++;R.vertices+=k[m].count;R.faces+=k[m].count/3}}elseif(k=d.drawcalls,0===k.length){b&&l(e,a,d,0);e=d.attributes.position;if(dinstanceofTHREE.InstancedBufferGeometry&&0<d.maxInstancedCount){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}einstanceofTHREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(f,
0,e.data.count,d.maxInstancedCount):p.drawArraysInstancedANGLE(f,0,e.count,d.maxInstancedCount)}elseeinstanceofTHREE.InterleavedBufferAttribute?s.drawArrays(f,0,e.data.count):s.drawArrays(f,0,e.count);R.calls++;R.vertices+=e.count;R.faces+=e.array.length/3}elsefor(b&&l(e,a,d,0),m=0,q=k.length;m<q;m++){if(dinstanceofTHREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");breaka}elses.drawArrays(f,k[m].start,k[m].count);
R.points+=b[p].count;elseif(c&&l(e,a,d,0),e=d.attributes.position,b=d.drawcalls,0===b.length)s.drawArrays(f,0,e.array.length/3),R.calls++,R.points+=e.array.length/3;elsefor(p=0,m=b.length;p<m;p++)s.drawArrays(f,b[p].index,b[p].count),R.calls++,R.points+=b[p].count};this.render=function(a,b,c,d){if(!1===binstanceofTHREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{vare=a.fog;wa="";Xa=-1;Wa=null;gb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();
a===THREE.CullFaceBack?s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),J.enable(s.CULL_FACE))};this.setTexture=function(a,b){varc=aa.get(a);if(0<a.version&&c.__version!==a.version){vard=a.image;if(void0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);elseif(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void0===c.__webglInit&&(c.__webglInit=!0,
if(ainstanceofTHREE.DataTexture)if(0<k.length&&d){for(varl=0,m=k.length;l<m;l++)e=k[l],J.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}elseJ.texImage2D(s.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);elseif(ainstanceofTHREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(f)?J.compressedTexImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):
k[m].count,c,k[m].start*h);R.calls++;R.vertices+=k[m].count;R.faces+=k[m].count/3}}elseif(b&&l(e,a,d,0),k=d.drawcalls,0===k.length){e=d.attributes.position;if(dinstanceofTHREE.InstancedBufferGeometry&&0<d.maxInstancedCount){p=W.get("ANGLE_instanced_arrays");if(null===p){console.error("THREE.WebGLRenderer.renderMesh: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");breaka}einstanceofTHREE.InterleavedBufferAttribute?p.drawArraysInstancedANGLE(f,
0,e.data.count,d.maxInstancedCount):p.drawArraysInstancedANGLE(f,0,e.count,d.maxInstancedCount)}elseeinstanceofTHREE.InterleavedBufferAttribute?s.drawArrays(f,0,e.data.count):s.drawArrays(f,0,e.count);R.calls++;R.vertices+=e.count;R.faces+=e.array.length/3}elsefor(m=0,q=k.length;m<q;m++){if(dinstanceofTHREE.InstancedBufferGeometry){console.error("THREE.WebGLRenderer.renderMesh: cannot use drawCalls with THREE.InstancedBufferGeometry.");breaka}elses.drawArrays(f,k[m].start,k[m].count);R.calls++;
elseif(c&&l(e,a,d,0),e=d.attributes.position,b=d.drawcalls,0===b.length)s.drawArrays(f,0,e.array.length/3),R.calls++,R.points+=e.array.length/3;elsefor(p=0,m=b.length;p<m;p++)s.drawArrays(f,b[p].index,b[p].count),R.calls++,R.points+=b[p].count};this.render=function(a,b,c,d){if(!1===binstanceofTHREE.Camera)console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{vare=a.fog;wa="";Xa=-1;Wa=null;gb=!0;!0===a.autoUpdate&&a.updateMatrixWorld();null===b.parent&&b.updateMatrixWorld();
s.cullFace(s.BACK):a===THREE.CullFaceFront?s.cullFace(s.FRONT):s.cullFace(s.FRONT_AND_BACK),J.enable(s.CULL_FACE))};this.setTexture=function(a,b){varc=aa.get(a);if(0<a.version&&c.__version!==a.version){vard=a.image;if(void0===d)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined",a);elseif(!1===d.complete)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete",a);else{void0===c.__webglInit&&(c.__webglInit=!0,a.__webglInit=!0,a.addEventListener("dispose",
d){for(varl=0,m=k.length;l<m;l++)e=k[l],J.texImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,f,h,e.data);a.generateMipmaps=!1}elseJ.texImage2D(s.TEXTURE_2D,0,f,e.width,e.height,0,f,h,e.data);elseif(ainstanceofTHREE.CompressedTexture)for(l=0,m=k.length;l<m;l++)e=k[l],a.format!==THREE.RGBAFormat&&a.format!==THREE.RGBFormat?-1<J.getCompressedTextureFormats().indexOf(f)?J.compressedTexImage2D(s.TEXTURE_2D,l,f,e.width,e.height,0,e.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):