In forward rendering, when there are multiple lights, Unity uses multiple passes.
“Base pass renders object with one per-pixel directional light and all SH/vertex lights. Additional passes are rendered for each additional per-pixel light that affect this object.” - from Unity documentation
I understand if lights are all done in a single pass, this pass will become super long and complicated, but other than that, is there any particular reason why Unity use multiple passes, instead of looping lights in a single shader pass?
Especially for per-pixel light, I feel one pass for each per-pixel light will cost lots of performance. For example. if there are eight per-pixel lights in the scene, that means eight draw calls.
Because Unity’s forward renderer was written over 7 years ago, not modern for desktop computers. Even the general thought in the industry the year or two Unity 5.0 came out was that deferred would be the dominant method of rendering for desktop and console, and forward rendering still needed to support OpenGL ES 2.0 devices for which a single pass lighting system doesn’t make as much sense for.
Going forward, especially with the popularity of >1080p resolutions and VR, single pass is making much more sense. Unity is currently working on a new rendering system that will plausibly completely replace the existing rendering paths with several new ones optimized for different platforms.