PDA

View Full Version : about lights



zydgyy
12-15-2011, 01:21 AM
Hi,i known maxmim number of lights is 8,so how can simulating a dozen lights?!

thokra
12-15-2011, 01:47 AM
This, among various other questions that you've asked, can be answered by a little bit of googling or by reading a recent book like the Superbible.

Aside from that, 8 lights are permitted only when using the fixed-function pipeline. With deferred shading and deferred lighting this limit is obsolete, as they are fully shader based approaches.

BionicBytes
12-15-2011, 03:03 AM
Also with all techniques there is nothing from stopping you from running multiple passes.

_arts_
12-15-2011, 04:24 AM
To be a bit more precise, if you do forward rendering, you generally render the scene once for each light. This is also the same for deferred rendering: you apply each light separately from your data stored in your FBO.

So you commonly never render several lights at once, whether you do forward rendering or deferred rendering, and even if you are stuck with no shaders.

aqnuep
12-18-2011, 06:31 AM
To be more precise, you have choices:

1. Use fixed function lighting
2. Use a shader based forward renderer
3. Use a deferred renderer
(actually there are more possibilities but I suppose this is enough)

In case of option #1, you need to render the scene once for each 8 lights and use additive blending to accumulate the results (or you can use also the accumulation buffer if you wish).

In case of option #2, you need to render the scene once for each light (or each N light, depending on the implementation), but again, you add together the results using additive blending.

In case of option #3, you need to render the scene only once, to the G-Buffer and then render the lights in additional full-screen, quad, or volume based passes, but the main point remains the same: use additive blending to accumulate the results.