   Light objects in deferred shading
  HelloI am trying to finish up a deferred shader and everything is working more or less as I expected but I am not able to draw the actual light objects, only the lighting in the objects.I would like to be able to see the lights as in [font=arial, sans-serif][size=2]http://www.doolwind.com/images/blog/lidr.jpg[/font]Can anyone help me understand how to do that?Thanks   
  Maybe I'm misunderstanding, but why don't you just draw a mesh that represents the type of light (e.g. point light = a sphere, spot light = a cone + sphere, direct light = plane ).   ;Maybe I'm misunderstanding, but why don't you just draw a mesh that represents the type of light (e.g. point light = a sphere, spot light = a cone + sphere, direct light = plane ).That was my first thought but then wouldn't I need to add it to the scene in order to render it? and wouldn't that mess around with the storage of information in the buffers during the geometry pass?   ;  You don't have to add them to the scene. You could simply run through all your lights in your renderer and draw them after you've combined your light buffer and g-buffer.   ;That was my first thought but then wouldn't I need to add it to the scene in order to render it?Everything you render needs to be added somehow. But don't add geometry for each light. Use instancing.and wouldn't that mess around with the storage of  information in the buffers during the geometry pass?You could render the light representing objects directly to the backbuffer.To achieve the look in the screenshot, you could probably just render a point sprite for each light.Or just look into the source code of the light indexed deferred rendering sample.   ;You don't have to add them to the scene. You could simply run through all your lights in your renderer and draw them after you've combined your light buffer and g-buffer.Do you mean that after the second pass, I do a third pass drawing the lights?   ;  Here is how my setup basically works:1 - draw geometry to g-buffer2 - draw lights to light buffer3 - combine g-buffer and light buffer and render to backbuffer4 - draw light geometry to backbuffer with depth testing turned onAs froop said, you don't need a seperate mesh for each light, but a seperate mesh for each light type ( e.g. one sphere for all point lights ).   