I am writing a GLSL program as part of a plugin that runs inside of Maya, a closed-source 3D application. My plugin renders custom geometry into the same image buffer that the application renders it's default polygonal geometry. The application uses the OpenGL fixed pipeline for it's lighting and shading but I am using GLSL to render custom geometry and materials.
My problem is, I want to mimic the behavior of the fixed pipeline lights in my shader. The application defines the lights in the gl_LightSource uniform and I want them to have the same direction, intensity etc when assigned to my custom geometry that they have when assigned to the application's default polygonal geometry.
The gl_LightSource fields are clearly documented but I cannot find definitive documentation of how the fixed-pipeline interprets those fields. There are many examples of how to code point/directional/spot lights in GLSL but they do not seem to exactly mimic the fixed pipeline. For example, how do you determine if a light is a point, directional or spot light if the application defines a mix of them? Can a mix of light types be handled without introducing excessive branching in my shader?
In short, is there any definitive documentation or example of how the fixed function pipeline evaluates gl_LightSource?