The first thing to do is explain what HDR is. (Edit: Actually, the first thing I should point out is that this page is mostly an out of date rant, and there's very little point in you reading it. Unless you're excessively bored, just go straight to the download page.) It stands for High Dynamic Range, and so, grammatically speaking, it shouldn’t be used on its own. I should probably be calling it HDR lighting, but I’m lazy. The ‘High Range’ part refers to the fact that the human eye is capable of detecting about 10 orders of magnitude of brightness. A computer monitor is capable of displaying around 2. The ‘Dynamic’ part refers to the fact that your eye can only view 2 or 3 orders of magnitude with any accuracy at a time, and that your pupil must constrict/relax to change the position of these 3 visible orders of magnitude. Any system that simulates this adjustment could be known as HDR.
One of the most irritating things about the TES hardware/software forums back when oblivion first came out was all the 10 year old x800 owners who think that just because their cutsy little graphics card lets them use HDR in HL2, then Oblivion’s should work as well. It doesn’t. Live with it. Oblivion uses ‘real’ floating point HDR. (I don't see why it should be considered any more real than other HDR methods, but everyone else seems to be refering to it as real HDR, so I might as well join in.) While this doesn’t strictly require SM3.0, it does require the graphics card to support floating point blending operations. There are no SM2.0 cards on the market which can do this. The ATI X000 series are not SM3.0 graphics cards. As an interesting anomaly, the nvidia 6200 is apparently a SM3.0 card, but can't do the necessary floating point blending operations required by oblivion, and so has the special status of being the only SM3.0 card which doesn’t let you use HDR lighting, much to many 6200 owners disgust. (Cue even more bloody 10 year olds starting even more annoying threads…)In addition, no nvidia card currently on the market supports using antialiasing and floating point blending at the same time. (Edit: This is no longer true; the 8000 series can manage it fine. Just turn HDR on in game and force AA on in the nvidia control panel.) As such, no nvidia card is able to use HDR and AA simultaneously. For some reason known only to them, Bethesda decided that this means that no graphics card at all will do HDR and AA simultaneously, much to the disgust of ATI X1000 series owners, which can. Fortunately, this little issue has already been solved by the infamous chuck patch, although this doesn’t seem to have stopped the flood of even more posts by irate ATI owners.
Now that I’ve got that little rant out of the way, lets move on to the real purpose of my SM2 HDR mod. Surprisingly, this has nothing to do with how I don’t have a SM3.0 card and wanted my own HDR effect. Neither does it have anything to do with how I have some nvidea 7000 series card and want to use HDR and AA together. In fact, as I’ve mentioned before my computer only scrapes oblivions minimum specifications. Since Bethesda originally lied about the min specs, I couldn't actually see this mod in game anywhere other than the tutorial dungeon back when I first wrote it, so many thanks to Lasukie on the TES forums for supplying the screenshots here and on TESsource. The real reason I wrote this was simply because I was bored, someone posted a request for a SM2.0 HDR effect, someone else posted saying that I could do it and I didn’t want to let anyone down. So the motto of that story; if you want me to do something, just wait till I’m really bored before asking, and sound really sure of yourself when you suggest that I might be able to do it.
This mod adds fake HDR lighting that not only works on sm2.0 cards, but which is also completely compatible with AA. The fps hit is usually comparable with oblivions normal HDR, and I’ve also written a cut down version which is a little faster. Remember that this is not true HDR: Real HDR increases the range of colours available to textures, but this mod actually decreases it slightly. Another problem is the fact that I can't run oblivion. The shader has been designed to work - not to look good. You will almost certainly need to tweak this mod to your own personal preferences. You can find some good threads about how to do this on the official TES forums, the main contributers being nicoroshi, Shirosae and Sir Drake. (The thread exists here at the time of writing.)
This mod is a very quick, (I wrote the first version in less than 2 hours,) hack of MGE. MGE was a mod I made for morrowind to add support for more advanced graphics features by hooking the d3d dll and intercepting morrowinds graphics calls. (And which incidentally took way way more than 2 hours to write. Closer to 8 months, in fact, although on average I probably only put in 10 minutes of work each day.) I don’t bother with any complicated hooking techniques - Since I’m targeting one specific game there’s no point doing anything too advanced. My method consists simply of creating a dll containing an implementation of the IDirect3D9 and IDirect3D9Device interfaces, renaming it to d3d9.dll and sticking it in the oblivion folder. Windows is kind enough to do the rest, by virtue of the fact that it searches the application dir before the system dir when loading dlls, so when oblivion tries to load ‘d3d9.dll’ windows loads my copy instead of the real one.
Once loaded, my dll loads the real one and returns a fake device to oblivion. When oblivion first creates the graphics device, I create a couple of extra textures, and when it calls present I copy the backbuffer to one of them and then redraw it using the shader. The dll keeps track of the brightness of the backbuffer by using a stretchrect chain to shrink it down to 1 pixel, and then locking and reading it. If you want more details, just look at the source code. It’s only 1 header and one source file, and all of the interesting stuff is in the FakeDevice::Present and FakeObject::CreateDevice functions.
There was a bit of a hiccup with ATI tray tools, which kept trying to hook my dll thinking it was the real one and crashing oblivion, but the ATT team were kind enough to fix this. Just remember to either use the latest version of ATT, or to use my ATT compatibility patch.