|
@@ -182,6 +182,8 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
var _glExtensionStandardDerivatives;
|
|
var _glExtensionStandardDerivatives;
|
|
var _glExtensionTextureFilterAnisotropic;
|
|
var _glExtensionTextureFilterAnisotropic;
|
|
var _glExtensionCompressedTextureS3TC;
|
|
var _glExtensionCompressedTextureS3TC;
|
|
|
|
+ var _glExtensionElementIndexUint;
|
|
|
|
+
|
|
|
|
|
|
initGL();
|
|
initGL();
|
|
|
|
|
|
@@ -897,8 +899,10 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- geometryGroup.__faceArray = new Uint16Array( ntris * 3 );
|
|
|
|
- geometryGroup.__lineArray = new Uint16Array( nlines * 2 );
|
|
|
|
|
|
+ var type = _glExtensionElementIndexUint ? Uint32Array : Uint16Array;
|
|
|
|
+
|
|
|
|
+ geometryGroup.__faceArray = new type( ntris * 3 );
|
|
|
|
+ geometryGroup.__lineArray = new type( nlines * 2 );
|
|
|
|
|
|
var m, ml;
|
|
var m, ml;
|
|
|
|
|
|
@@ -3003,16 +3007,17 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
if ( material.wireframe ) {
|
|
if ( material.wireframe ) {
|
|
|
|
|
|
setLineWidth( material.wireframeLinewidth );
|
|
setLineWidth( material.wireframeLinewidth );
|
|
-
|
|
|
|
|
|
+ var type = _glExtensionElementIndexUint ? _gl.UNSIGNED_INT : _gl.UNSIGNED_SHORT;
|
|
if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglLineBuffer );
|
|
if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglLineBuffer );
|
|
- _gl.drawElements( _gl.LINES, geometryGroup.__webglLineCount, _gl.UNSIGNED_SHORT, 0 );
|
|
|
|
|
|
+ _gl.drawElements( _gl.LINES, geometryGroup.__webglLineCount, type, 0 );
|
|
|
|
|
|
// triangles
|
|
// triangles
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
+ var type = _glExtensionElementIndexUint ? _gl.UNSIGNED_INT : _gl.UNSIGNED_SHORT;
|
|
if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglFaceBuffer );
|
|
if ( updateBuffers ) _gl.bindBuffer( _gl.ELEMENT_ARRAY_BUFFER, geometryGroup.__webglFaceBuffer );
|
|
- _gl.drawElements( _gl.TRIANGLES, geometryGroup.__webglFaceCount, _gl.UNSIGNED_SHORT, 0 );
|
|
|
|
|
|
+ _gl.drawElements( _gl.TRIANGLES, geometryGroup.__webglFaceCount, type, 0 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -3738,7 +3743,7 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
if ( geometry.geometryGroups === undefined ) {
|
|
if ( geometry.geometryGroups === undefined ) {
|
|
|
|
|
|
- geometry.makeGroups( material instanceof THREE.MeshFaceMaterial );
|
|
|
|
|
|
+ geometry.makeGroups( material instanceof THREE.MeshFaceMaterial, _glExtensionElementIndexUint ? 4294967296 : 65535 );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6475,6 +6480,9 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
_glExtensionCompressedTextureS3TC = _gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );
|
|
_glExtensionCompressedTextureS3TC = _gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || _gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );
|
|
|
|
|
|
|
|
+ _glExtensionElementIndexUint = _gl.getExtension( 'OES_element_index_uint' )
|
|
|
|
+
|
|
|
|
+
|
|
if ( ! _glExtensionTextureFloat ) {
|
|
if ( ! _glExtensionTextureFloat ) {
|
|
|
|
|
|
console.log( 'THREE.WebGLRenderer: Float textures not supported.' );
|
|
console.log( 'THREE.WebGLRenderer: Float textures not supported.' );
|
|
@@ -6499,6 +6507,12 @@ THREE.WebGLRenderer = function ( parameters ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ( ! _glExtensionElementIndexUint ) {
|
|
|
|
+
|
|
|
|
+ console.log( 'THREE.WebGLRenderer: elementindex as unsigned integer not supported.' );
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
if ( _gl.getShaderPrecisionFormat === undefined ) {
|
|
if ( _gl.getShaderPrecisionFormat === undefined ) {
|
|
|
|
|
|
_gl.getShaderPrecisionFormat = function() {
|
|
_gl.getShaderPrecisionFormat = function() {
|