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
uStrokeWeightis 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.
예제
구문
strokeShader(s)
매개변수
관련 레퍼런스
p5.Shader
A class to describe a shader program.
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.
version
Shaders are written in GLSL, but there are different versions of GLSL that it might be written in.