r/processing • • Dec 19 '25

Books on using Shaders in Processing

I found a good video tutorial on using shaders in p5js here on this subreddit.

I was wondering if there is any up-to-date book on the use of shaders in processing. Any recommendations for learning how to use shaders and shaders in Processing?

4 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/EnslavedInTheScrolls Dec 25 '25 edited Dec 25 '25

No, you can definitely do shader versions all the way up to the "present" (OpenGL 4.6 circa 2018), it's just that Processing internally uses older version shaders so that they have full backwards compatibility with older or weaker computers (think Raspberry Pi).

It's not hard to

import java.nio.*;
import com.jogamp.opengl.*;

and start using OpenGL commands on your own with as modern version of OpenGL as your computer / graphics drivers / OS supports. Be warned that Apple stopped supporting OpenGL with version 4.1 or so. On Windows or Linux you can run up to 4.6.

Typically, in OpenGL you use vertex attribute buffers to pass geometry to the shaders, but that can tangle with Processing's use of them, so I've taken to using SSBOs which are both simpler and more general to use since a shader can both read and write to them.

I'm also a big fan of using bufferless rendering. That's where you tell opengl to render 1000 triangles without passing in any data and have the vertex shader position and animate them based entirely on the gl_VertexID and any uniforms you pass in such as "time". See https://www.vertexshaderart.com/ for example.