shader()#

Applies the shader specified by the parameters.

Examples#

 1def setup():
 2    global edges
 3    global img
 4    py5.size(640, 360, py5.P2D)
 5    img = py5.load_image("leaves.jpg")
 6    edges = py5.load_shader("edges.glsl")
 7
 8
 9def draw():
10    py5.shader(edges)
11    py5.image(img, 0, 0)

Description#

Applies the shader specified by the parameters. It’s compatible with the P2D and P3D renderers, but not with the default renderer.

Underlying Processing method: shader

Syntax#

shader(shader: Py5Shader, /) -> None
shader(shader: Py5Shader, kind: int, /) -> None

Parameters#

  • kind: int - type of shader, either POINTS, LINES, or TRIANGLES

  • shader: Py5Shader - name of shader file

Updated on March 22, 2022 21:53:01pm UTC