It draws white (if I remove the color.rgb = 1.-color.rgb; line, it draws black).
I know the fbo contains the video texture, as I’ve tried drawing that separately.
Ok - solved for now… but still seems like there’s a bug (?) in passing the video texture to the shader
i.e.
[ error ] ofTexture: getTextureData(): texture has not been allocated
That might be due to AVFoundationPlayer?
In any case, the solution for that was to draw the video into an fbo and pass the fbo texture to the shader.
For the shader issue itself (not drawing the texture) - I realized in the past I’ve used ofDisableArbTex() in order to use sampler2D. Instead I’m now using sampler2DRect, per below:
invert.frag
#version 120
uniform sampler2DRect u_tex0;
uniform vec2 u_resolution;
void main () {
vec2 st = gl_FragCoord.xy/u_resolution; // normalize coords
st.y = 1.-st.y; // invert y to draw normally per openFrameworks
st *= u_resolution; // de-normalize coords
vec4 color = vec4(st.x,st.y,0.,1.);
color = texture2DRect(u_tex0,st); // grabs texture data using non-normalized coords
color.rgb = 1.-color.rgb;
gl_FragColor = color;
}