Skip to content

Commit

Permalink
Revert "BatchedMesh: Add support for Instanced rendering with sorting…
Browse files Browse the repository at this point in the history
…, frustu…" (#28461)

This reverts commit 02ed248.
  • Loading branch information
gkjohnson committed May 22, 2024
1 parent 464170a commit 496acf9
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 224 deletions.
16 changes: 3 additions & 13 deletions examples/webgl_mesh_batch.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@
function initBatchedMesh() {

const geometryCount = api.count;
const vertexCount = geometries.length * 512;
const indexCount = geometries.length * 1024;
const vertexCount = api.count * 512;
const indexCount = api.count * 1024;

const euler = new THREE.Euler();
const matrix = new THREE.Matrix4();
Expand All @@ -194,17 +194,7 @@

for ( let i = 0; i < api.count; i ++ ) {

let id;
if ( i < geometries.length ) {

id = mesh.addGeometry( geometries[ i % geometries.length ] );

} else {

id = mesh.addInstance( i % geometries.length );

}

const id = mesh.addGeometry( geometries[ i % geometries.length ] );
mesh.setMatrixAt( id, randomizeMatrix( matrix ) );

const rotationMatrix = new THREE.Matrix4();
Expand Down
Loading

0 comments on commit 496acf9

Please sign in to comment.