I have a odd error happening so I want to check the limitations on InstanceMesh.
The instance mesh I created is dynamic, so the count will change.
this.mesh = new InstancedMesh(new PlaneGeometry(), this.material, count);
this.mesh.instanceMatrix.setUsage(DynamicDrawUsage);
I am using a CurvePath and add some curves to hit that includes
QuadraticBezierCurve3
CubicBezierCurve3 and
Several LineCurve3
I update the vectors of two LineCurve3 and then need to do an update.
The drawing I am doing is to render a plane on the path given an amount of space.
this.mesh.count = count;
for (let i = 0; i <= count; i++) {
const norm = i / count;
const tangent = this.curvePath.getTangent(norm);
axis.crossVectors(up, tangent).normalize();
const radians = Math.acos(up.dot(tangent));
const point = this.curvePath.getPointAt(norm);
this.dummy.position.copy(point);
this.dummy.scale.set(this.xScale, this.yScale, 1);
this.dummy.quaternion.setFromAxisAngle(axis, radians);
this.dummy.updateMatrix();
this.mesh.setMatrixAt(i, this.dummy.matrix);
}
this.mesh.instanceMatrix.needsUpdate = true;
This works fine when you have a small curve set but when the count gets to 85 ish count on the instance mesh I get a draw call error.
[.WebGL-00006DD400213B80] GL_INVALID_OPERATION: Internal error: 0x00000502: Vertex buffer is not big enough for the draw call.
:8000/#curves:1 WebGL: too many errors, no more errors will be reported to the console for this context.
Any idea as to why I am getting this error and what I can do to have a larger instance mesh?
Full source can be found at
update method.
Any assistance will be greatly appreciated.