View Full Version : Deferred Shading

10-09-2014, 08:45 PM
in first pass, we execute VS and FS for all the objects in a scene so MRT will have values for closest pixels. Now in light pass, do we execute the VS for all the objects a scene ? if yes, then FS should execute for all the pixels(extra pixels which wont get rendered) unless early Z is enabled. how does it work? how does the FS executes only for closest pixels?

carsten neumann
10-10-2014, 12:56 AM
After you've filled your G-Buffer you only render full screen quads or (more efficiently) geometry that corresponds to the area affected by a light source, e.g. a cone for a spot light or a sphere for a point light. That way you execute the lighting fragment shader only for pixels affected by the light source.