InstancedMesh but with different material for each instance
Per use request, we would like to built a 2D viewer for rendering of toolpaths for 3D printing where the user looks at the current layer from the top-view in orthographic projection. So far so easy. Our users want to annotate lines, s.t. lines with individual coloring.
Currently our viewer uses two triangles to emulate a 2D line object. For each instance of a line segment of the toolpaths, a line instance gets easily computed into a Mat4 object, which performs the linear transformation. In this context, all lines are an instance of the same line, i.e. the same Gm.
The image shows a section of a million lines rendered and the picking feature from this framework. It's literally blazingly fast!
To add the new feature to the viewer, I was asking myself, if I could still use the upper approach or if for each line of individual, unique coloring, I would have to instanciate a new Gm. I think the latter would result in a much more inefficient viewer.
Any thoughts?