Saturday, July 25, 2009

Project Mod SVN 10

Tonight I added an HDR deferred shading system:

  • A simple shader writes surface color, normal, and world position to a trio of RGBA16F screen-sized textures.

  • The blend target (a fourth RGBA16F screen-sized texture) is cleared.

  • For each light in the scene one of the light shaders uses the three deferred textures to compute the light's contribution to each pixel, which is added to the blend target.

  • The tone mapping shader exposes and gamma corrects each blended pixel and writes them to the back buffer


I'm cheating right now by hard coding a point light and a spot light into the renderer code, but it should be easy enough to generalize. The code is a bit ugly, but it's all confined to the renderer class.







Up next: shadow mapping.

No comments:

Post a Comment