diff --git a/examples/webgl_gpgpu_birds_gltf.html b/examples/webgl_gpgpu_birds_gltf.html
index 18895ed1e66308..fd64fef652cf13 100644
--- a/examples/webgl_gpgpu_birds_gltf.html
+++ b/examples/webgl_gpgpu_birds_gltf.html
@@ -233,7 +233,7 @@
/* BAKE ANIMATION INTO TEXTURE and CREATE GEOMETRY FROM BASE MODEL */
const BirdGeometry = new THREE.BufferGeometry();
- let textureAnimation, durationAnimation, birdMesh, materialShader, vertexPerBird;
+ let textureAnimation, durationAnimation, birdMesh, materialShader, indicesPerBird;
function nextPowerOf2( n ) {
@@ -260,7 +260,7 @@
const morphAttributes = birdGeo.morphAttributes.position;
const tHeight = nextPowerOf2( durationAnimation );
const tWidth = nextPowerOf2( birdGeo.getAttribute( 'position' ).count );
- vertexPerBird = birdGeo.getAttribute( 'position' ).count;
+ indicesPerBird = birdGeo.index.count;
const tData = new Float32Array( 4 * tWidth * tHeight );
for ( let i = 0; i < tWidth; i ++ ) {
@@ -414,7 +414,7 @@
cohesion: 20.0,
freedom: 0.75,
size: sizes[ selectModel ],
- count: BIRDS
+ count: Math.floor( BIRDS / 4 )
};
@@ -425,7 +425,7 @@
velocityUniforms[ "cohesionDistance" ].value = effectController.cohesion;
velocityUniforms[ "freedomFactor" ].value = effectController.freedom;
if ( materialShader ) materialShader.uniforms[ "size" ].value = effectController.size;
- BirdGeometry.setDrawRange( 0, vertexPerBird * effectController.count );
+ BirdGeometry.setDrawRange( 0, indicesPerBird * effectController.count );
};