Some new interesting information about valve's HDR implementation

bloodbob said:
Ehh the alpha blend surfaces aren't supposed to obstruct a bloom. I could be wrong but when you alphablend with a value of say 0.99 isn't 0.99 written to the frame buffer? If so then when you read the alpha value out of the frame buffer isn't it going to be 0.9? Won't such a high number bloom?

Yes you're right, it's the surface causing the bloom that should be obstructed (which is what happens).

The alpha value written to the frame depends on the state of DESTBLENDALPHA & SRCBLENDALPHA (SEPERATEALPHABLENDENABLE must be true).
When using alphablending, I set dest to INVSRCALPHA and src to ZERO which have the effect that the value written to the framebuffer is the one already in it blended with zero. This is just like regular blending except that i've forced the incoming alpha to 0.

For normal surfaces I just turn off alphablending and the frambuffer alpha is written as is.
 
Yeap coolies that would work. Its all shaders these days you forget about the old fixed function features.
 
Last edited by a moderator:
Chalnoth said:
Oh, for art assets I can definitely believe that FP16 won't happen very quickly at all.

I'm not even sure it's about "quickly", but rather "at all". Some will certainly use it, but I don't think it's ever going to dominate, even when the market is saturated with hardware down to low-end with all supporting FP16 as good as they do RGBA8 today. It's like RGBA8 still doesn't dominate the LDR texturing scene, in fact, it's been losing ground to DXTC for quite a while. With ALU power growing much faster than TEX I don't really see many people using wide formats when solutions like DXT1+L16 like I used in my HDR demo works equally well, at less than 1/3 the storage space and bandwidth requirement.
 
Chalnoth said:
Oh, and it seems like any solution that uses MRT's would require blending support for MRT's. Does current hardware support blending with MRT's? Doesn't seem like a trivial thing to support.

Blending is supported with MRTs. That's what makes it a good solution on current hardware if you have moderate ranges. If you use all four MRTs you can get quite good results even with quite large ranges.

Chalnoth said:
And storing the framebuffer in two parts like that would likely have huge problems with blending for values just above 1, unless you also decoded the framebuffer just like you'd have to do with the soft-FP thing I put up above. After all, a value of 1.01 blended with 0.99 would blend to 0.5 if you just do a straight blend with that encoding.

Well, the idea isn't to store it in two parts, like first one representing fractional part and the other integers up to 255, but rather to output the results scaled to different ranges, then when decoding it in the shader you look up which MRT to use depending on range. Say you use [0, 8] range and two MRTs. When rendering to the MRTs you'd basically do like this:

Code:
float4 result = ...  // Your normal output value
 
oC0 = result;
oC1 = result / 8.0;

Blending with this will work fine, since both are linear, just different ranges. Then when you decode it in the shader you do like this:

Code:
float4 tex0 = tex2D(MRT0, texCoord);
float4 tex1 = tex2D(MRT1, texCoord) * 8.0;
 
float4 value = (tex0 < 1)? tex0 : tex1;

So basically, if low range value goes through the roof, you use the higher range value. By adding another two MRTs you could easily cover ranges up into the hundreds with fairly good quality.
 
Ah, that makes sense. That could be a workable method of HDR on MRT hardware. The performance/quality ratio will not come close to comparing with FP16, but at least it will support antialiasing on current hardware.
 
Humus said:
I'm not even sure it's about "quickly", but rather "at all". Some will certainly use it, but I don't think it's ever going to dominate, even when the market is saturated with hardware down to low-end with all supporting FP16 as good as they do RGBA8 today. It's like RGBA8 still doesn't dominate the LDR texturing scene, in fact, it's been losing ground to DXTC for quite a while. With ALU power growing much faster than TEX I don't really see many people using wide formats when solutions like DXT1+L16 like I used in my HDR demo works equally well, at less than 1/3 the storage space and bandwidth requirement.
Well, it may be that at some time in the next five years, texture bandwidth and storage space start to become a relative non-issue, and thus people start moving towards FP16 textures just to make things easy. But I agree, there's just not any good reason to use full FP16 textures unless there just isn't any significant performance difference (which definitely will not be the case for the forseeable, but fast-changing, PC graphics technology sector).
 
Well, this is overlooking what could be the ubiquity of HDR lightprobes in the future.

BTW Humus, do you agree that HDR operations should be supported in hardware? You seem to be fond of various hacks to shoehorn custom HDR solutions into older hardware, but surely you're not advocating leaving true HDR support (blending, AA, compression, et all) out of HW?
 
Last edited by a moderator:
TBH, I think Humus want to force everyone to go back to mode X, the only graphics mode hack-ish enough for his needs. ;)
 
Chalnoth said:
Well, it may be that at some time in the next five years, texture bandwidth and storage space start to become a relative non-issue, and thus people start moving towards FP16 textures just to make things easy.

Well, storage space maybe, but not bandwidth. We're moving in the other direction, with memory bandwidth increasing much slower than ALU power. Trading two or tree instructions for 1/3 the bandwidth of wide texture formats will pay off most of the time and even more so in the future.
 
Humus said:
Well, storage space maybe, but not bandwidth. We're moving in the other direction, with memory bandwidth increasing much slower than ALU power. Trading two or tree instructions for 1/3 the bandwidth of wide texture formats will pay off most of the time and even more so in the future.
Maybe. Really depends upon how much ALU instructions grow with respect to texture instructions, I think. But then again, since memory bandwidth is so expensive, it may just be that IHV's won't push to get memory bandwidth large enough that we have plenty of it if the software starts making things easier on memory bandwidth.
 
DemoCoder said:
Well, this is overlooking what could be the ubiquity of HDR lightprobes in the future.

What's that supposed to mean?

DemoCoder said:
BTW Humus, do you agree that HDR operations should be supported in hardware? You seem to be fond of various hacks to shoehorn custom HDR solutions into older hardware, but surely you're not advocating leaving true HDR support (blending, AA, compression, et all) out of HW?

Surely not. I'm certainly in favor of all that. But there's still an assload of R300s out there, and any game developer implementing HDR will have to work with that, unless they target a small niche market. The reason I've been talking a lot on HDR and various techniques recently is because I've spent quite some time researching the subject recently. There will be a phat paper on the subject in the next ATI SDK. HDR is also returning as a buzzword now after having been mostly a techdemo thing ever since the 9700 launch, but now finally is being implemented in real games.
 
  • Like
Reactions: Geo
Humus said:
The reason I've been talking a lot on HDR and various techniques recently is because I've spent quite some time researching the subject recently. There will be a phat paper on the subject in the next ATI SDK.

Ya just gotta love the sound of that. Ya just gotta.
 
Nice spank for GTX. :smile: Should 1800XT be competitive or better, I can imagine ATI pointing at this as evidence as their new gen being more than 50% faster than their old gen. . . :LOL:
 
geo said:
Nice spank for GTX. :smile: Should 1800XT be competitive or better, I can imagine ATI pointing at this as evidence as their new gen being more than 50% faster than their old gen. . . :LOL:

A 6% drop is hardly a spank; but then again 1024 is abysmally low for such cards. If there are going to be 50% differences compared to anything, then almost definitely not in 1024 with 2xAA LOL.
 
radeonic2 said:
Nice performance with the ati cards:D

Did you mean that sarcastically? Look at the difference between the 6800 GT and the X850XT without HDR. Doesn't the X850XT typically spank the 6800 GT much harder than that? Relatively speaking, the X850XT is doing rather poorly here, with or without HDR.

Maybe 6800 performance has gone up with new tuning and features (SM 3.0?) for it, or perhaps the level complexity or composition makes them more equal somehow. It's also rather strange that the 7800 GTX only offers 30% more performance over the 6800 GT even without HDR. I guess the tighter band even without HDR must mean something else is affecting the benchamrk greatly, but I hesitate to call it a CPU bottleneck. What do you think? (At least the 7800 GTX pulls away with 70% more performance over the 6800 GT with HDR enabled)
 
wireframe said:
Did you mean that sarcastically? Look at the difference between the 6800 GT and the X850XT without HDR. Doesn't the X850XT typically spank the 6800 GT much harder than that? Relatively speaking, the X850XT is doing rather poorly here, with or without HDR.

Maybe 6800 performance has gone up with new tuning and features (SM 3.0?) for it, or perhaps the level complexity or composition makes them more equal somehow. It's also rather strange that the 7800 GTX only offers 30% more performance over the 6800 GT even without HDR. I guess the tighter band even without HDR must mean something else is affecting the benchamrk greatly, but I hesitate to call it a CPU bottleneck. What do you think? (At least the 7800 GTX pulls away with 70% more performance over the 6800 GT with HDR enabled)
I thought they'd be even slower honestly, figureing the R420 is based on old tech and the NV40 spanks it in shader power.
As for non hdr performance, I have no idea wtf is up with the numbers.. we'll see when it gets here how it is.
 
Ailuros said:
A 6% drop is hardly a spank; but then again 1024 is abysmally low for such cards. If there are going to be 50% differences compared to anything, then almost definitely not in 1024 with 2xAA LOL.

Hmm, are we looking at the same numbers? I see GTX spanking X850 XT by 50% in HDR. . .
 
geo said:
Hmm, are we looking at the same numbers? I see GTX spanking X850 XT by 50% in HDR. . .


I think he is referring to the drop from normal rendering to HDR on the 7800GTX.
 
Back
Top