Render Target Setup

RT Zero: Holds the pixel color.

RT One: Holds the the normal and emissive val at each pixel. The emissive value is a multiplier onto the Diffuse color. 1.0f being max emissive (Added diffuse color) and 0.0f being no emissive addition.

RT Two: Holds the depth at the current fragment and is later used to rebuild the fragment’s world space position. Specular multiplier is placed in RT2.

*All render targets can be switched to RGBA16 for memory concerns.

*Depth can be place in RT0.a, allowing us to use RT2.rgb for a specular color. It’s currently in this setup to experiment with alpha blending.

Rendering Pipeline

Populate GBuffers: Draw all geometry to populate render targets and the depth buffer.

Final Pass: Using RT0, RT1, RT3, and RT4 blend the accumulated light with the fragment’s diffuse and emissive colors.

If Post Process or Reflectibe Pass: If any post processing is needed, use the final scene that was rendered to RT2 and render it to RT0. The other render targets are now open for ping-ponging for different post-processing effects.