[page:Material] → [page:ShaderMaterial] →

[name]

A material for drawing wireframe-style geometries. Unlike [page:LineBasicMaterial], it supports arbitrary line widths and allows using world units instead of screen space units. This material is used with [page:LineSegments2] and [page:Line2].

Lines are always rendered with round caps and round joints.

Examples

[example:webgl_lines_fat WebGL / lines / fat ]
[example:webgl_lines_fat_raycasting WebGL / lines / fat / raycasting ]
[example:webgl_lines_fat_wireframe WebGL / lines / fat / wireframe ]
[example:webgpu_lines_fat WebGPU / lines / fat / raycasting ]

Constructor

[name]( [param:Object parameters] )

[page:Object parameters] - (optional) an object with one or more properties defining the material's appearance. Any property of the material (including any property inherited from [page:ShaderMaterial]) can be passed in here.

The exception is the property [page:Hexadecimal color], which can be passed in as a number or hexadecimal string and is `0xffffff` (white) by default. [page:Color.set]( color ) is called internally.

Properties

See the base [page:ShaderMaterial] class for common properties.

[property:Color color]

[page:Color] of the material, by default set to white (0xffffff).

[property:Boolean dashed]

Whether the line is dashed, or solid. Default is `false`.

[property:number dashOffset]

Where in the dash cycle the dash starts. Default is `0`.

[property:number dashScale]

The scale of the dashes and gaps. Default is `1`.

[property:number dashSize]

The size of the dash. Default is `1`.

[property:number gapSize]

The size of the gap. Default is `1`.

[property:Float linewidth]

Controls line thickness. Default is `1`.

[property:Vector2 resolution]

The size of the viewport, in screen pixels. This must be kept updated to make screen-space rendering accurate. The [page:LineSegments2.onBeforeRender] callback performs the update for visible objects. Default is `[1, 1]`.

[property:Boolean worldUnits]

Whether the material's sizes (width, dash gaps) are in world units. Default is `false` (screen space units.)

Methods

See the base [page:ShaderMaterial] class for common methods.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/lines/LineMaterial.js examples/jsm/lines/LineMaterial.js]