浏览代码

AddDrawcall: Simplify calls with explicit indexOffset of zero

dubejf 10 年之前
父节点
当前提交
8eb87c7b63

+ 1 - 1
examples/js/loaders/AWDLoader.js

@@ -699,7 +699,7 @@
 						attrib = new THREE.BufferAttribute( buffer, 1 );
 						geom.addAttribute( 'index', attrib );
 
-						geom.addDrawCall( 0, str_len / 2, 0 );
+						geom.addDrawCall( 0, str_len / 2 );
 
 						idx = 0;
 

+ 1 - 1
examples/js/loaders/UTF8Loader.js

@@ -99,7 +99,7 @@ THREE.UTF8Loader.BufferGeometryCreator.prototype.create = function ( attribArray
 	geometry.addAttribute( 'normal', new THREE.BufferAttribute( normals, 3 ) );
 	geometry.addAttribute( 'uv', new THREE.BufferAttribute( uvs, 2 ) );
 
-	geometry.addDrawCall( 0, indices.length, 0 );
+	geometry.addDrawCall( 0, indices.length );
 
 	geometry.computeBoundingSphere();
 

+ 1 - 1
examples/js/loaders/gltf/glTFLoader.js

@@ -104,7 +104,7 @@ THREE.glTFLoader.prototype.load = function( url, callback ) {
 		var geometry = this.geometry;
 
 		geometry.addAttribute( 'index', new THREE.BufferAttribute( this.indexArray, 1 ) );
-		geometry.addDrawCall( 0, this.indexArray.length, 0 );
+		geometry.addDrawCall( 0, this.indexArray.length );
 
 		geometry.computeBoundingSphere();
 	};

+ 2 - 2
examples/webgl_buffergeometry_drawcalls.html

@@ -147,7 +147,7 @@
 
 				}
 
-				particles.addDrawCall( 0, particleCount, 0 );
+				particles.addDrawCall( 0, particleCount );
 				particles.addAttribute( 'position', new THREE.DynamicBufferAttribute( particlePositions, 3 ) );
 
 				// create the particle system
@@ -161,7 +161,7 @@
 
 				geometry.computeBoundingSphere();
 
-				geometry.addDrawCall( 0, 0, 0 );
+				geometry.addDrawCall( 0, 0 );
 
 				var material = new THREE.LineBasicMaterial( {
 					vertexColors: THREE.VertexColors,

+ 1 - 1
examples/webgl_interactive_raycasting_pointcloud.html

@@ -160,7 +160,7 @@
 				}
 
 				geometry.addAttribute( 'index', new THREE.BufferAttribute( indices, 1 ) );
-				geometry.addDrawCall( 0, indices.length, 0 );
+				geometry.addDrawCall( 0, indices.length );
 
 				var material = new THREE.PointCloudMaterial( { size: pointSize, vertexColors: THREE.VertexColors } );
 				var pointcloud = new THREE.PointCloud( geometry, material );

+ 2 - 2
src/core/BufferGeometry.js

@@ -561,7 +561,7 @@ THREE.BufferGeometry.prototype = {
 
 				if ( this.drawcalls.length === 0 ) {
 
-					this.addDrawCall( 0, indices.length, 0 );
+					this.addDrawCall( 0, indices.length );
 
 				}
 
@@ -746,7 +746,7 @@ THREE.BufferGeometry.prototype = {
 
 		if ( this.drawcalls.length === 0 ) {
 
-			this.addDrawCall( 0, indices.length, 0 );
+			this.addDrawCall( 0, indices.length );
 
 		}