tEd said:
the r300 and nv30 should theoretical be able to do more than 1ppl in 1pass with the ability of 16textures/pass. i have the impression that the way the doom3 engine render the scene you need at least 5passes for 5lights even if the hardware could do it in less passes.
You could compress (expand, actually
) the stencil for several lights into a texture. For example, into a four-component texture you could easily store the stencil for 4 lights, so the texture component is 255 for stencil equals 1 and 0 for stencil equals 0.
Then, instead of using stencil tests, you modulate each light contribution using the right component of that texture.
The problem is that even if you can access 16 different textures, you only have 8 vec4 texture interpolators (this is what DX9 requires and what r300 has, can't remember NV30 :?), so it will also depend on how many texture interpolators doom3 needs per light and how many can be shared among different lights. I guess that each light needs an independent interpolator fot the projective lightmap, but the normalised tangent space can be shared among lights. The light vector and half-angle will also be different for each light.
So more than having enough different textures, the main problem is the number of different interpolators: You can always pretend you have more textures by compacting them into a 3D texture (with some limitations), but you will still be limited by the number of texture interpolators.