Currently, new materials are created for every single block instance. It might be more efficient to create them once up front.
Something like...
import * as THREE from 'three';
export const materials = [
new THREE.MeshBasicMaterial({ color: 0x00ff00 }),
new THREE.MeshBasicMaterial({ color: 0xff0000 }),
new THREE.MeshBasicMaterial({ color: 0x0000ff }),
]
Make sure not to dispose the materials array
Currently, new materials are created for every single block instance. It might be more efficient to create them once up front.
Something like...
Make sure not to dispose the materials array