Get the shader used when drawing the strokes of shapes.
You can call baseStrokeShader().modify()
and change any of the following hooks:
Hook | Description |
---|---|
| Called at the start of the vertex shader. |
| Update the vertex data of the stroke being drawn before any positioning has been applied. It takes in a
|
| Update the vertex data of the model being drawn after transformations such as |
| Update the vertex data of the model being drawn as they appear relative to the camera. It takes in a |
| Called at the end of the vertex shader. |
| Called at the start of the fragment shader. |
| Update the inputs to the shader. It takes in a struct
|
| Caps and joins are made by discarded pixels in the fragment shader to carve away unwanted areas. Use this to change this logic. It takes in a |
| Update the final color after mixing. It takes in a |
| Called at the end of the fragment shader. |
Most of the time, you will need to write your hooks in GLSL ES version 300. If you are using WebGL 1 instead of 2, write your hooks in GLSL ES 100 instead.
Call baseStrokeShader().inspectHooks()
to see all the possible hooks and their default implementations.
Ejemplos
Sintaxis
baseStrokeShader()
Parámetros
Returns
Referencias Relacionadas
copyToContext
Copia el shader de un contexto de dibujo a otro.
setUniform
Establece los valores de las variables uniformes (globales) del shader.
ambientMaterial
Establece el color ambiental del material de la superficie de las formas.
createFilterShader
Crea un objeto p5.Shader para ser utilizado con la función filter().