im quiet new to graphic programming,, been programing for quiet some time now.
Im trying to understand some general of how lighting works (not the shader logic behind it), and how it should be structured with in a program.
Lets say i have X objects in my scene, and 3 different types of light sources lets say that all lights sources affects all objects, Point, Spotlight, Diffuse. As i understand it i need 3 different shaders (same shader compiled with different defines or one that is branched). In a more standard approach (I guees its called Forward Rendering) Do I need to render render each object 3 times with a different shader each time seems a bit inefficient in my untrained eyes. and if so will the output be automatically merged or do i need to something?
If i have same scenario but i use a Deferred approach how would that work?