OpenGL: How to render perfect rectangular gradient?
问题 I can render triangular gradient with simply just one triangle and using glColor for each corner. But how to render perfect rectangular gradient? I tried with one quad, but the middle will get ugly seam. I also tried with texture of 2x2 size, it was like it should be done: proper blending from each corner, but the texture sampling precision becomes unprecise when stretched too much (i started to see pixels bigger than 1x1 size). Is there some way of calculating this in a shader perhaps? --