Showing posts tagged lighting
The big display is the HDR light accumulation buffer and the strip at the bottom is to visualize the average luminance downsampling to 1x1. I’m interested to try using the 2x2 texture for the average luminance in tone mapping instead of the 1x1.
EDIT: [Insert fail here.] So I forgot to convert my luminance to the log domain before downsampling, because everyone knows you can’t linearly filter luminance… :-/
Implemented directional light in the deferred pipeline. Also added sRGB texture support and gamma correction; the bottom half is gamma accurate.
All the lighting stuff that I’ve posted up to this point has been using the forward rendering pipeline. Now I’m working on the deferred shading pipeline. The G-buffer is in place and the LA-buffer (light accumulation) is also working. The LA-buffer uses a 4-channel 16-bit floating point render target so I can support high dynamic range (HDR) lighting. The RGB is the diffuse color and the A holds the specular.
So far, I’ve only implemented ambient lighting, which is probably the easiest of them all. Instead of rendering a full-screen quad with the ambient color, I just clear the LA-buffer using the RGB of the ambient light and the A channel with 0.
I didn’t realize I had a problem with my aspect ratio until I added a sphere model. Seems I forgot to cast my int width and int height to floats before aspectRatio = width / height; which was giving me a 1 for all resolutions. Man, what a rookie mistake.
If you try to calculate a TBN matrix for applying per-pixel surface normal mapping from an empty texture, you get weird results.
Point lights and some nice, meaty fails.