load-shader

reset-shaderclj

shaderclj

load-shader

Arguments
[fragment-filename vertex-filename][fragment-filename]
Docstring
Loads a shader into the PShader object. Shaders are compatible with the
P2D and P3D renderers, but not with the default renderer.
Works only inside sketch functions?
Yes
Original Processing method
loadShader()
Example
clojure specific
  • (let [gr (q/create-graphics 250 250)
          path (clojure.java.io/resource "SimpleShader.glsl")
          shd (q/load-shader (.getPath path))]
      (q/with-graphics gr
        (q/background 255)
        (q/fill 255 0 0)
        (q/triangle 50 30 220 120 20 180))
      (q/image gr 0 0)
      (q/image gr 250 0)
      (q/shader shd)
      (q/image gr 0 250)
      (q/reset-shader)
      (q/image gr 250 250))

reset-shaderclj

Arguments
[kind][]
Docstring
Restores the default shaders. Code that runs after (reset-shader) will
not be affected by previously defined shaders. Optional 'kind' parameter -
type of shader, either :points, :lines, or :triangles
Works only inside sketch functions?
Yes
Original Processing method
resetShader()
Example

There are no examples for this function. You can request examples which will help us to prioritize this funciton.

shaderclj

Arguments
[shader kind][shader]
Docstring
Applies the shader specified by the parameters. It's compatible with the :p2d
and :p3drenderers, but not with the default :java2d renderer. Optional 'kind'
parameter - type of shader, either :points, :lines, or :triangles
Works only inside sketch functions?
Yes
Original Processing method
shader()
Example

There are no examples for this function. You can request examples which will help us to prioritize this funciton.