This seems like a pretty elementary math/graphics question, but for some reason I can't seem to wrap my head around it.
What I've got is four line segments, outlining a quad. Each vertex on each line segment has a known color value. For simplicity, let's assume that each line segment has 100 vertices (aka 100 known color points). An example might look something like this:
What I need to do is, render a solid quad with every internal pixel colored, based on the colors of the points on the outline. The most obvious way to do this (without specifying a vertex for every 100*100 color point) would be to first generate a 100x100 bitmap with each interpolated color value, then apply this as a texture to the quad. I'm just having difficulty figuring out how to calculate those internal color values.
It seems like it would be a matter of bilinear interpolation, but since I'm not trying to find values within four known corner points but at the intersection of a "+" of known color points, I keep getting confused. My math is a bit rusty :P
As an example, how might I approach calculating the color value of the point at (50,50) - in the middle of the quad - with known color points at (0,50), (50,0), (50,100), and (100,50)? Is this even bilinear interpolation, or is it something else entirely?
Thanks in advance!