I could use a little help working out a piece of code.
Basically what I need to do is to interpolate a 2D texture into a flat 2D quad bi-linearly. Now, I tried simply drawing the quad and setting each corner of the quad to each corner of the texture. My brain soon forgot that OpenGL breaks the quads into tris and this is what I got
Now what I want to do, is to smoothly interpolate the texels between all four corners, like this
(did this with the GIMP, btw)
I’m assuming I could fix the texture coordinates inside the shader, but I can’t wrap my head on how to do it. Any other ideas are very welcome