THREE.MeshLine
THREE.MeshLine copied to clipboard
Merging geometries
I had the idea of generating lots of lines (that have the same material properties), and merging them for use in one single Mesh in order to reduce the number of Mesh objects added to the scene (and therefore the number of draw calls).
However, simply trying that yielded… no results. (still, it was worth a shot) :)
Anyway – would it be possibly to perform a merge on MeshLine geometries? Or is it limited by how these lines work?
Maybe this could have a .toBufferGeometry()
method?
The problem is that each line is a sequence of vertices (it's expanded into a strip of triangles).
How could one single geometry be drawn in split lines? I can't think of a way
I guess if you used tubes instead of polys that needed to be rotated towards camera...
i'd need support for merged discontinous lines too. Basically what THREE.Linesegment does. It repeats the vertices in the array, like 0 1, 1 2, 2 3, ...
Will this be possible?
Frederick's suggestion is probably the best, but personally I dealt with discontinuous MeshLines by hiding the desired segments. Add a bufferAttribute for vertex visibility and pass a positive alphaTest in MeshLineMaterial.
Posted some code in #34 if you like.
Quick and dirty :+1: