Point Shaders on Mac?

edited October 2016 in GLSL / Shaders

Hello, I am running Processing release 3.2.1 on a fully updated MacBook Pro and I am having strange issues trying to get point shaders to work in a sketch. Below is a minimal piece of code to reproduce it.

First, this is in a file called pTest.glsl:

#version 410

out vec4 fragColor;

void main() {
  fragColor = vec4(1.0,0,0,1.0);
}

And then this in the sketch:

PShader pTest;

void setup() {
  size(512,512,P3D);
  pTest = loadShader("pTest.glsl");
}

void draw() {
  background(0);
  shader(pTest,POINTS);
  stroke(255);
  strokeWeight(10);
  point(256,256,0);
  //filter(pTest);
}

What I am expecting it to do is render a red point in the middle of the screen. If you comment out the shader line it renders the expected point. Also if you comment out the shader line, and uncomment the filter line it renders the entire screen in red, so I know that the shader itself is valid. But, if I try to run the code as written above, it gives me the error "OpenGL error 1282 at bot endDraw(): invalid operation". Googling this shows that a lot of people used to get this if they needed to update their graphics drivers, but that isn't the case for me. Anyone have any ideas?

Sign In or Register to comment.