I want to change my existing application from Forward Shading to Deferred Lighting.
I read that Deferred Lighting works with MSAA from the start. But I don't understand why.
In Deferred Lighting, we have a "n-buffer" which stores surface normals per screen pixel. We also have a "light buffer" which accumulates the intensity of diffuse lighting. (Let's ignore specularity for the moment).
Deferred LIghting has 3 steps:
1. Render geometry (surface normals and z-buffer only) to n-buffer
2. Render light volumes, adding their contributions into the light buffer
3. Render geometry again, reading from the light buffer to calculate final shading.
In my understanding, the backbuffer is antialised while n-buffer and light buffer are not.
In MSAA, the pixel shader is executed for each pixel center where one of the sub-samples is occupied by a triangle.
Wouldn't that mean that in step 3, the pixel shader would read from the wrong values in the light buffer, as the light buffer is not antialiased?