Thickness of lines using THREE.LineBasicMaterial

1) Use native OpenGL

You can achieve rendering of line thicknesses with a workaround by setting your browser to use native OpenGL instead of ANGLE. You can read here on how to do this on Chrome.
Keep in mind that you will experience performance differences if you swap to native OpenGL.

EDIT:

The master MrDoob himself posted here how to do this for both Chrome and Firefox.

Note: This first option is no longer a valid solution since the latest OpenGL versions no longer support line thickness either. Check also @gman his answer. This means if you want to use line thickness the second option is the way to go.


2) Use THREE.MeshLine class

There is also another solution; this THREE.MeshLine class on github is a nice workaround. It comes with a special THREE.MeshLineMaterial. According to the docs it is as simple as:

  • Create and populate a geometry
  • Create a THREE.MeshLine and assign the geometry
  • Create a THREE.MeshLineMaterial
  • Use THREE.MeshLine and THREE.MeshLineMaterial to create a THREE.Mesh

Leave a Comment