|The problem is that from what I can find via Google, flat shading via GLSL is all but impossible.|
What makes you think this? Just output the same colour for each fragment of a given triangle.
|I wish it were that simple, but it isn't. In order to calculate the color of each fragment, I must first calculate the angle between the light ray and the normal. Unfortunately, the normals are interpolated across the polygon, so for each fragment, the calculated color value changes. This is the definition of smooth shading. What I need to do is shut off the normal interpolation, while leaving z and uv interpolation alone. I don't think that GLSL has a method of doing that.|
|I think I found the code in Blender that changes between flat and smooth shading and all it does is call glShadeModel. However, that is depreciated and I would like to stay clear of depreciated functions. If that is how Blender does it, that is a point that must be looked into. At some point in the future, flat shading will break.|