Timeline for Deferred shading - how to combine multiple lights?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 15, 2012 at 23:07 | comment | added | CodeNeko | Ah, that make a lot more sense and would considerable better. | |
Mar 15, 2012 at 22:56 | comment | added | JBeurer | Nope, deferred shading doesn't work that way. I have to draw the scene only once and store relevant information in G-Buffer. Then a sphere of influence for each light and blend it with the light buffer. And finally combining light buffer with colorbuffer I get the final shaded color buffer. The amount of lighting computations doesn't depend on scene complexity. That is the main advantage of deferred shading in the first place. | |
Mar 15, 2012 at 22:27 | comment | added | CodeNeko | The main reason I stated this, is if you are using only two or a few lights, it can help. Especially if you are rending many object, using a blend means you need to redraw the scene for each light, so if you have a a lot of shapes, say one million, or ten million or a billion, each draw costs a lot more to do. Doing it in the shader causes issues if you want lots of lights, but blend causes issues if you want lots of shapes. If you have lots of both, you need to find a middle ground, but usually you have a few lights and lots of objects in games. | |
Mar 12, 2012 at 23:58 | comment | added | JBeurer | No, that doesn't work that way. I draw a sphere for each point light. Unless the second point light lies withing the sphere of influence of the first light, the second light simply wont be drawn. Your method would work if I draw a fullscreen quad for all the pointlights, however, that is not the correct approach because fullscreen quads are used for global ilumination. Say I have 16 small point lights, that would force me to go through them for each pixel even if the pixel is not lit by it. And usually I'd say each pixel is lit by a one or two lights. And what if i have 100 lights? NO | |
Mar 12, 2012 at 23:27 | history | answered | CodeNeko | CC BY-SA 3.0 |