Quite unfortunately, Processing does not (yet?) support floating-point textures or framebuffers. I submitted a feature request for them to github just before @davepagurek announced them in p5, but as far as I know, no one has worked on it for Processing. And since Processing doesn’t use floating-point textures, PGL has no support either.
You could try to write the direct OpenGL yourself to create floating-point textures through JOGL, which I have not tried, but that has a tendency to tangle with Processing’s own internal texture management. Instead, I have been using SSBOs which let you pass general float or integer values to and from the GPU. Your problem there, however, is that they require OpenGL 4.3 which came out after Apple took their toys and went home to create their own graphics library, Metal, and stopped supporting versions after 4.1.
Another possibility is, in the shader, to interpret the 4x8-bit texture colors as integers letting you pass in one or more coordinates per pixel. You could either use a fixed point representation or use the GLSL function intBitsToFloat()
to convert to a floating-point value along with Java’s Float.floatToIntBits()
.
Or just bite the bullet and use the full OpenGL vertex array buffers. I shared an example rendering a million animating points here: https://discourse.processing.org/t/cant-render-opengl-mesh-and-p3d-components-at-the-same-time/44624/2. If you want circle points instead of the default squares you can add the line
if( length(gl_PointCoord.xy-0.5)>0.5 ) { discard; }
to the fragment shader.