Ian wrote:Unfortunately the code I tested can't handle crazy shape quads

So maybe back to the drawing board or write myself something from scratch
I did find this which looked quite promising
https://stackoverflow.com/questions/149 ... -in-openglbut doesn't handle perspective so would essentially be an affine transform
Ah I see now. I think I was correct about how Gouraud shading works but indeed, if it's not rasterized natively as a quad, it will be different because the interpolation from side to side will occur between one edge and the hypotenuse (assuming an ordinary quad), rather than across the entire span of the quad. This sounds really tricky but it will be fascinating to see if you can implement an elegant solution! If I recall correctly, it was the norm for software 3D engines in the 90's (e.g., Quake) to support either both triangles and quads, or convex polygons of an arbitrary number of sides. I remember writing a software rasterizer way back when (it's still on my web site
here!) and this was the natural way to do it (not triangulating). Never really did anything fancy like shading so I never gave much thought to this.