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
Related References
copyToContext
Copies the shader from one drawing context to another.
inspectHooks
Logs the hooks available in this shader, and their current implementation.
modify
Returns a new shader, based on the original, but with custom snippets of shader code replacing default behaviour.
setUniform
Sets the shader’s uniform (global) variables.