Reference strokeShader()

strokeShader()

Sets the p5.Shader object to apply for strokes.

This method applies the given shader to strokes, allowing customization of how lines and outlines are drawn in 3D space. The shader will be used for strokes until resetShader() is called or another strokeShader is applied.

The shader will be used for:

  • Strokes only, regardless of whether the uniform uStrokeWeight is present.

To further customize its behavior, refer to the various hooks provided by the baseStrokeShader() method, which allow control over stroke weight, vertex positions, colors, and more.

Examples

Syntax

strokeShader(s)

Parameters

s
p5.Shader: p5.Shader object to apply for strokes.
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/material.js and open a pull request!

Related References