I've finally decided to mess around with lighting in the game project I have, but I'd like to ask for some advice from the people that have done this already. One of my main issues with reading existing code examples is breaking the light maths down in to its constituent components (examples seem to contain all three together), those being
- Lighting Types (Point / Spot / Direction etc
- Shading Types (Flat / Gourard etc
- Illumination Types (Blinn Phong / Cook Torrance / Lambert / etc)
With the meta data being material information (ambient / diffuse / specular / shininess)
For this post I am not asking for examples of implementing the above, I can read up on that myself. What I would like some help on is working out the generic inputs to those component and the outputs of those components. Once I have this I can create a framework for plugging in the various lighting / shading / illumination types.
This is my current view on things
Light Type : - Inputs : Normals, Normal Matrix, Light Position
Outputs : ??
Shading Type - Inputs : ??
Outputs : ??
Illumination Type - Inputs : Material properties, ??
Outputs : Color
As you can see I don't really know much
I think understanding the complete picture will make implementing the algorithms much easier.