I’m working on a video mixer with blending modes done in GLSL. What I have trouble with is how to use a rectangular (16:9) texture with JUCE and OpenGL. The OpenGLTexture class forces a square texture, deforming my video data, and the standard way (glGenTextures, bind, …) does not seem to work.
Is JUCE doing anything to prevent the standard texture get to the shader? Or does anyone have other tips to make this work?
I’ve just now realized that the texture doesn’t have to be square, just with dimensions that are powers of two. With that in mind I’ve resolved to using this oversized texture and manipulating the texture coords in the shader, something along the lines of:
The texture is twice verticaly flipped (once by not using loadARGBFlipped and once in the shader), which is ok – otherwise the manipulated coords look at the bottom of the texture (which is empty). However manipulating the texture coords doesn’t feel right.