My question is related to this answered Q from a couple years ago, which I got working: three.js texture across InstanceGeometry
I'm updating my application from r95 to the latest r124.
First I make the InstancedBufferGeometry (Geometry.createBuffered is my own bit that pops out any type of geometry from some JSON):
let bg = Geometry.createBuffered(id, params.instance.geo),
ig : InstancedBufferGeometry = new InstancedBufferGeometry(),
mesh;
ig.copy( bg );
THen I set about generating InstancedBufferAttributes from JSON params and assigning them to the IBG:
for(var x = 0; x < xl; x++){
for ( var y = 0; y < yl; y++) {
for ( var z = 0; z < zl; z++) {
ox = ( x * params.instance.arrayPlacement.spacing[0] - disX ) + Math.random() * ( params.instance.arrayPlacement.displacement[1] - params.instance.arrayPlacement.displacement[0] ) + params.instance.arrayPlacement.displacement[0];
oy = ( y * params.instance.arrayPlacement.spacing[1] - disY ) + Math.random() * ( params.instance.arrayPlacement.displacement[1] - params.instance.arrayPlacement.displacement[0] ) + params.instance.arrayPlacement.displacement[0];
oz = ( z * params.instance.arrayPlacement.spacing[2] - disZ ) + Math.random() * ( params.instance.arrayPlacement.displacement[1] - params.instance.arrayPlacement.displacement[0] ) + params.instance.arrayPlacement.displacement[0];
offsets[ count * 3 ] = ox;
offsets[ ( count * 3 ) + 1 ] = oy;
offsets[ ( count * 3 ) + 2 ] = oz;
scales[count] = Math.random() * (params.instance.arrayPlacement.scale[1] - params.instance.arrayPlacement.scale[0]) + params.instance.arrayPlacement.scale[0];
orientations[ count * 4 ] = -0.5;
orientations[ ( count * 4 ) + 1 ] = -0.5;
orientations[ ( count * 4 ) + 2 ] = -0.5;
orientations[ ( count * 4 ) + 3 ] = 0.5;
uvOffsets[ count * 2 ] = y;
uvOffsets[ ( count * 2 ) + 1 ] = x;
iCount[ count * 2 ] = 1/yl;
iCount[ ( count * 2 ) + 1 ] = 1/xl;
count++;
}
}
}
let roti : InstancedBufferAttribute = new InstancedBufferAttribute( orientations, 4).setUsage( DynamicDrawUsage ),
offs : InstancedBufferAttribute = new InstancedBufferAttribute( offsets, 3 ).setUsage( DynamicDrawUsage ),
uvOffs : InstancedBufferAttribute = new InstancedBufferAttribute( uvOffsets, 2 ).setUsage( DynamicDrawUsage ),
iC : InstancedBufferAttribute = new InstancedBufferAttribute( iCount, 2 ).setUsage ( DynamicDrawUsage ),
scas : InstancedBufferAttribute = new InstancedBufferAttribute( scales, 1 ).setUsage( DynamicDrawUsage );
ig.setAttribute( 'offset', offs );
ig.setAttribute( 'uvOffset', uvOffs);
ig.setAttribute('iCount', iC);
ig.setAttribute( 'iScale', scas );
ig.setAttribute( 'orientation', roti );
Then, I make a material with a customized shader with uvoffsets and colors. However, when I create a mesh with even a basic 3js material nothing appears. If I inspect the Scene, the Mesh is there, no errorsscreenshot
UPDATE: @Mugen87 is correct, I was still running r115. sorry about that. I'm on r124 now, but I strangely still see maxInstancedCount, as well as instanceCount (as undefined) when I create an IBG. Also, when I use IBG.copy(BoxBufferGeometry), the geometry does not seem to be copied in. I assumed BoxBufferGeometry creates a BufferGeometry? Or is that coming in r125?

maxInstancedCountis undefined on your pic. You need to set it with the amount of instances. Justig.maxInstancedCount = _some_integer_;, after when you set attributes. - prisoner849