Sets the p5.Shader object to apply for images.
This method allows the user to apply a custom shader to images, enabling advanced visual effects such as pixel manipulation, color adjustments, or dynamic behavior. The shader will be applied to the image drawn using the image() function.
The shader will be used exclusively for:
image()calls, applying only when drawing 2D images.- This shader will NOT apply to images used in texture() or other 3D contexts. Any attempts to use the imageShader in these cases will be ignored.
예제
구문
imageShader(s)
매개변수
s
p5.Shader: p5.Shader object to apply for images.
Notice any errors or typos? Please let us know. Please feel free to edit src/webgl/material.js and open a pull request!
관련 레퍼런스
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.