I just finished reading the optimization paper and had a question.
If the number of draw calls is to be reduced (balanced) and if the game needs multiple pixel lights, would it make sense to change the base shaders - which only handle one light at a time - to add computation of the n lights the game needs, say 20 (in one shader)
this assumption is based on the fact that modern gpu 6800 and above can handle fairly long shaders.
Currently Unity can’t do that, but it’s something I definitely want to add.
Behind the scenes it has more problems that are visible on the surface:
GLSL on OpenGL is still quite unstable; and other shader programs (ARB_vertex_program/ARB_fragment_program) have serious limitaitons, e.g. they can’t do loops.
On D3D9, pixel shaders 3.0 can’t be used with fixed function lighting (and vice versa, vertex shaders 3.0 can’t be used with fixed function fragment processing).
if lights use different cookie textures, or use shadows, etc.; they generally can’t be combined.
The idea is good and it will probably be implemented “someday”, I’m just trying to explain why it’s not there yet