I\'m trying to use multiple textures in a single PointCloud using a ShaderMaterial. I\'m passing a texture array to the shader along with texture index attributes and select
The new version of Three.js doesn't support attributes in ShaderMaterial. We'll have to delete attributes: attributes
in new THREE.ShaderMaterial
and use geometry.addAttribute
instead. Here's the code to define texIndex:
var vIndex = new Float32Array( vertices.length );
for ( var i = 0, l = vertices.length; i < l; i ++ ) {
vIndex[i] = Math.random()*getTextures().length;
}
geometry.addAttribute( 'texIndex', new THREE.BufferAttribute( vIndex, 1 ) );