Im currently trying to get my head around shaders. Have tried adapting the the “VideoMappingWithShader” fragment shader from gohai’s GL video Pi library to add a gradient to the video.
i get a “OpenGL error 1282 at top endDraw(): invalid operation” error and strangly the checkerboard shows but when switching to the video i just get a white square.
Processing code hasnt changed except for a shader.set(“u_resolution”, width, height); at the end of setup.
As this affects the whole output, do you have any advice on putting the blend inside the processed fragment shader area? Ie so the blend directly affects the keystoned area and not over the whole output?
Trying gl_FragColor = texture2D(texture, vertTexCoord.st / vertTexCoord.p, blend); didnt seem to effect it EDIT: scrap that, i see thats the Coordinate bias
Last question. i have implemented vec2 st = vertTexCoord.st+1./resolution; although im not sure why i need the +1. (or any value for that matter) as vec2 st = vertTexCoord.st./resolution gives a black canvas. do i need to offset vertTexCoord.st for some reason? ie are we going from -.5,+.5 to 0,1?