So I think I think I've finally finished the deliverable for my 'HDR Demo'. Short of any show-stoppers then I think I can happily draw a line under it and move on to the next thing.
Although, in my final read-through of all the source code I found a somewhat embarassingly stupid mistake [headshake]. Corrected that and it all automagically worked exactly as expected [grin]
I recently implemented Reinhard's tone mapping equations into my pipeline, and one of the changes it requires is to compute both the average world luminance and the maximum world luminance. This works nicely in the luminance down-sampling section, but instead of the regular RxxF single-channel format I now needed a two channel GxxRxxF format.
Nothing complex there. I modified my enumeration code to handle it and rewrote parts of my shaders. Thing is, it didn't really do anything. I spent a few hours tweaking things - assuming that I'd just got the param balances wrong and it just wasn't adding much to the image.
Turns out that what I actually did was modify my enumeration code (IDirect3D9::CheckDeviceFormat()) to check for D3DFMT_G32R32F and/or D3DFMT_G16R16F but it still returned D3DFMT_R32F or D3DFMT_R16F. That is, I didn't change all of the necessary lines.
** Cue very loud "D'Oh" and slapping of ones forhead **
So, the shaders were reading and writing from a nonexistant channel. Clever bit is that the read operation didn't return garbage - presumably a 0.0 or 1.0 default value. Which didn't obviously break it - the application didn't die and didn't create any noticeably crazy results. Damn those defaults
So I changed 4 lines of code to return the correct format, and voila! it's looking perfect [smile]
I want to post my notes on the Ward Reflection Lighting Model today... but Wolfgang Engel's book is driving me up the bloody wall (why isn't there a review of it on this site?) - too many typo's and general WTF's that I have to go looking for the original paper. Unfortunately the only copy of the original I can find online is so poorly scanned you can't read the maths. Luckily the university library has a back catalog of SIGGRAPH proceedings - so I'm gonna go find 1992's and see if I can make sense of it [smile]
Till later or tomorrow.