Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/webgl_gpgpu_birds_gltf.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {

Expand All @@ -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 ++ ) {
Expand Down Expand Up @@ -414,7 +414,7 @@
cohesion: 20.0,
freedom: 0.75,
size: sizes[ selectModel ],
count: BIRDS
count: Math.floor( BIRDS / 4 )

};

Expand All @@ -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 );

};

Expand Down