File: LineMaterial.md | Updated: 11/15/2025
A material for drawing wireframe-style geometries.
Unlike LineBasicMaterial, it supports arbitrary line widths and allows using world units instead of screen space units. This material is used with LineSegments2 and Line2.
This module can only be used with WebGLRenderer. When using WebGPURenderer, use Line2NodeMaterial.
LineMaterial is an addon, and must be imported explicitly, see Installation#Addons.
import { LineMaterial } from 'three/addons/lines/LineMaterial.js';
Constructs a new line segments geometry.
parameters | An object with one or more properties defining the material's appearance. Any property of the material (including any property from inherited materials) can be passed in here. Color values can be passed any type of value accepted by Color#set.
---|---
Whether to use alphaToCoverage or not. When enabled, this can improve the anti-aliasing of line edges when using MSAA.
Overrides: ShaderMaterial#alphaToCoverage
The material's color.
Default is (1,1,1).
Where in the dash cycle the dash starts.
Default is 0.
The scale of the dashes and gaps.
Default is 1.
The size of the dash.
Default is 1.
Whether the line is dashed, or solid.
Default is false.
The size of the gap.
Default is 0.
This flag can be used for type testing.
Default is true.
Controls line thickness in CSS pixel units when worldUnits is false (default), or in world units when worldUnits is true.
Default is 1.
Overrides: ShaderMaterial#linewidth
The opacity.
Default is 1.
Overrides: ShaderMaterial#opacity
The size of the viewport, in screen pixels. This must be kept updated to make screen-space rendering accurate.The LineSegments2.onBeforeRender callback performs the update for visible objects.
Whether the material's sizes (width, dash gaps) are in world units.
Default is false.