GLSL Shaders using Processing Pi on a Pi 3 B+

@jshaw3 I revised your code slightly:-

import processing.video.Movie;

PShader mixShader;

PGraphics pg;
PGraphics pg2;

Movie movie;
Movie movie2;

void settings() {
  size(640, 360, P2D);
  noSmooth();
}

void setup() {
  pg = createGraphics(640, 360, P2D);
  movie = new Movie(this, "LabspaceDawnv1blur2.mp4");
  movie.loop();
  movie2 = new Movie(this, "LabspaceFireblur2.mp4");
  movie2.loop();
  pg = createGraphics(width, height, P2D);
  pg2 = createGraphics(width, height, P2D);
  mixShader = loadShader("fadeshader.glsl");
  mixShader.set("iResolution", float(width), float(height));
  mixShader.set("iTime", millis()/1000.);

  mixShader.set("iChannel0", pg);
  mixShader.set("iChannel1", pg2);
}

void movieEvent(Movie m) {
  m.read();
}

void draw() {
  pg.beginDraw();
  pg.image(movie, 0, 0, width, height);
  pg.endDraw();
  pg2.beginDraw();
  pg2.image(movie2, 0, 0, width, height);
  pg2.endDraw();
  shader(mixShader);
  rect(0, 0, width, height);
}

Then I could run the sketch on RaspberryPI4 using ManjaroArmLinux (64 bit) and the latest iteration of processing-4.0 with the latest video library. I also got rid off the sub-folder in the data folder (ps also movie files should not have spaces in their names). Since buster I’ve not bothered trying to install processing on my RasberryPI3B+. I’ll have a go with my PiCrate gem on the RaspberryPI3B+, and report back.

1 Like