4 ms·
Recently I came across http://iquilezles.org/www/articles/ibilinear/ibilinear.htm http://iquilezles.org/www/articles/ibilinear/ibilinear.htm when researching ho
by ino 9y ago
Recently I came across http://iquilezles.org/www/articles/ibilinear/ibilinear.htm http://iquilezles.org/www/articles/ibilinear/ibilinear.htm when researching how to draw textured non-parallelogram quadrilaterals, without affine texture mapping, with WebGL / OpenGL ES 2.
I was disappointed to learn that OpenGL wouldn't do it and we have to calculate it on our own and send in a 3rd texture coordinate to each vertex for extra calculation on the shader.
Sadly, there isn't much useful info on this subject on the internet (I'm not talking about projective mapping, but bilinear interpolation).
I've found this: http://www.reedbeta.com/blog/quadrilateral-interpolation-part-2/ http://www.reedbeta.com/blog/quadrilateral-interpolation-par... that I think will work for my case.
My problem is that I also use normals to do "fake" parallel lighting on quads and it accentuates even more the affine errors on non parallelogram quadrilaterals. It's easier to just subdivide the quad to minimize the affine artifacts.
If anyone knows a better way to solve it, I'd love to learn.