I have created a simple point-based drawing engine that uses shaders(in Cg language) to draw a scene. Now I do not know how to light the scene. Defining lights and properties that worked in fixed pipeline obviously does not work here. I am interested in two things:
- is it possible to automatically light a pixel/scene like it was using only fixed pipeline rendering? If, how can I do this?
- if I have to perform all the calculations manually, can you tell m how do I do that or point me in the right direction? I was thinking I would have to pass all lights and properties as static values and use them to calculate proper color in fragment shader. What equations do I need for that?