From 8eb87c7b634fee68b5def2f011a628ec83f7fccc Mon Sep 17 00:00:00 2001 From: dubejf Date: Wed, 15 Jul 2015 13:15:28 -0400 Subject: [PATCH] AddDrawcall: Simplify calls with explicit indexOffset of zero --- examples/js/loaders/AWDLoader.js | 2 +- examples/js/loaders/UTF8Loader.js | 2 +- examples/js/loaders/gltf/glTFLoader.js | 2 +- examples/webgl_buffergeometry_drawcalls.html | 4 ++-- examples/webgl_interactive_raycasting_pointcloud.html | 2 +- src/core/BufferGeometry.js | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/js/loaders/AWDLoader.js b/examples/js/loaders/AWDLoader.js index ab6c74479a..54bf9ee37e 100644 --- a/examples/js/loaders/AWDLoader.js +++ b/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; diff --git a/examples/js/loaders/UTF8Loader.js b/examples/js/loaders/UTF8Loader.js index de5fc46669..40540d9ce1 100644 --- a/examples/js/loaders/UTF8Loader.js +++ b/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(); diff --git a/examples/js/loaders/gltf/glTFLoader.js b/examples/js/loaders/gltf/glTFLoader.js index 4e340769ac..3eb3b176ba 100644 --- a/examples/js/loaders/gltf/glTFLoader.js +++ b/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(); }; diff --git a/examples/webgl_buffergeometry_drawcalls.html b/examples/webgl_buffergeometry_drawcalls.html index 5d2eec37bd..fa07f8ae7e 100644 --- a/examples/webgl_buffergeometry_drawcalls.html +++ b/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, diff --git a/examples/webgl_interactive_raycasting_pointcloud.html b/examples/webgl_interactive_raycasting_pointcloud.html index 45825579c1..951c295930 100644 --- a/examples/webgl_interactive_raycasting_pointcloud.html +++ b/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 ); diff --git a/src/core/BufferGeometry.js b/src/core/BufferGeometry.js index 8d498ca226..d50b5aae1c 100644 --- a/src/core/BufferGeometry.js +++ b/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 ); } -- GitLab