Skip to content

API Reference

Makio MeshLine is build with creative coding requierement in mind : performance, customization, simplicity so you can focus on your creativity.

It's build for the futur, using TSL and is compatible only with the new WebGPURenderer (But both backend: WebGPU/WebGL2)

MeshLine

High-level façade – the class you will use 99 % of the time.

ts
new MeshLine(options?: MeshLineOptions)

For better convenience use the fluent API bellow

ts
new Meshline().color(0xff0000).gradient(0xff00ff) //etc..

MeshLineGeometry

Low-level geometry builder – it's created internally by the Meshline, reach for it when you need to update or add extra buffer attributes.

ts
new MeshLineGeometry(options?: MeshLineGeometryOptions)

MeshLineNodeMaterial

Specialised NodeMaterial that understands the vertex attributes generated by MeshLineGeometry and renders them with:

  • Screen-space or size-attenuated thickness
  • Optional gradients, textures, dashes, etc..
  • Optional miter-clipping for super-sharp corners
  • Optional TSL hooks to customize the vertex & fragment easily
ts
new MeshLineNodeMaterial(parameters?: MeshLineNodeMaterialParameters)

Implementation Notes

  • Only the uniforms / attributes needed are created & uploaded to the GPU.
  • There is many hooks available for customizing the basic behavior / rendering of the lines
  • Instancing + gpu position will allow you to render thousands of lines like a breeze
  • You can also use batching for performant cpu controled animation or static lines
  • No runtime dependencies beyond three