IQ differences in Humus shader replacement vs standard shader

pxc

Extremely [H]
Joined
Oct 22, 2000
Messages
33,063
I made comparisons from the static scene playdemo shot_demo001 using both the default shader and last Humus replacement. It doesn't seem to be just an exponent problem to match the values like he kept insisting, the specular texture lookup he avoids is just different.

http://www.notveryserio.us/pix/normal1024x768uq.png original shader
http://www.notveryserio.us/pix/hack1024x768UQ.png Humus's shader replacement
http://www.notveryserio.us/pix/differences.png differences, brighter = larger differences

Viewed individually, the hack looks fine. But it's not a direct replacement. I'm highlighting 5 of the worst sections, but most of the image is affected as you can see from the 3rd link above. The brighter image with slightly different specular values to the right is the Humus hack.
normal-1.png
hack-1.png
animation 1 (avi) open the url in your preferred media player or right click and save as
normal-2.png
hack-2.png
animation 2 (avi)
normal-3.png
hack-3.png
animation 3 (avi)
normal-4.png
hack-4.png
animation 4 (avi)
normal-5.png
hack-5.png
animation 5 (avi)

That is in 1024x768 Ultra Quality, so texture/map compression isn't an issue, and all included images and animations are lossless PNG/uncompressed full quality.

I posted this only to counter the belief that the calculated specular value was a direct replacement for the specular texture look up. It's not because it skips a feature of the D3 engine (specular texture lookup) and that's why it shouldn't be used to compare performance. But I think it's pretty cool anyways and I don't mind that it helps 9800/x800 users.
 
Could someone do a subtractive layer-deal in Photoshop, to get a more specific look at where the shaders differ?

My understanding from today's Carmack interview on Beyond3D is that Humus' hack gives a close approximation to, but not quite mathematically identical substitution for the default shader. The differences are still minimal enough that I'd take the IQ hit for the extra performance, if I had an X800.

EDIT: That's what I get for skimming and just looking at the pretty pictures.
 
I agree. This seems a fairly good approximation now that the bugs have been worked out. Ideally ATi would release a driver fix so the x800s could do it the normal way without the wierd performance hit...but this is a good hold over till that happens, I'm sure we could all use a couple more fps in d3...
 
yeah but if they do it in the driver people will be screaming shader replacement :eek:
 
rancor said:
yeah but if they do it in the driver people will be screaming shader replacement :eek:

no not replace the shader in the driver...fix the anistropic silliness...
 
why would they fix anything in the drivers regarding this.... just let the game choose the filtering and dont force the card using the cp to do filtering the game creator did't ask for to be done
 
In the mouseover I cannot tell a difference. This monitor @ work is extremely dark, but still..
 
Carmack said this about the specular map in the new "mini-interview" ( http://www.beyond3d.com/interviews/carmack04/index.php?p=2 ):

"...
The specular function in Doom isn't a power function, it is a series of clamped biases and squares that looks something like a power function, which is all that could be done on earlier hardware without fragment programs. Because all the artwork and levels had been done with that particular function, we thought it best to mimic it exactly when we got fragment program capable hardware. ...

It should be noted that a power function is a strictly empirical approximation of a surface's specular response, so other specular approximations shouldn't be looked at as just approximating a power function. For instance, especially for broad highlights, it is nice to have a finite cutoff angle, rather than the power limit approach.

The lookup table is constant in Doom, so there isn't any real strong argument against replacing it with code. The lookup table was faster than doing the exact sequence of math ops that the table encodes, but I can certainly believe that a single power function is faster than the table lookup."

IOW, to do the exact replacement for the specular texture in code is slower than just looking it up. Replacing it with a simpler single function is faster of course, but doesn't match the specular texture.
 
I kind of like th ebrighter look, it's more vivid instead of dull. Mainly to help make up for the fact that my 19" monitor sucks hardcore. I had to adjust the gamma a lot and the brightness on doom 3 to hell before I got it too be able to see and still had the scary effect. :D
 
Too close to call, I know that I would chose the one that gave me more FPS, I don't think anyone would be able to sit down at a computer and pick which was which. I wish people would stop crying about this shit.
 
creedAMD said:
Too close to call, I know that I would chose the one that gave me more FPS, I don't think anyone would be able to sit down at a computer and pick which was which. I wish people would stop crying about this shit.

Personally I think the tweak is fine, just the way it was released was unprofessional and almost seemed like a PR stunt. Humus has easy private access to Carmack and id Software due to his employment at ATI, there was no reason to criticize Carmack's code publically and release a public "fix" on a forum when he could have easily talked to Carmack directly through private channels about the code change due to his position at ATI.
 
Honestly the quality dosen't look that different, but if you are paying the big $$$ for a good video card, why wouldn't you want the game looking exactly like it is supposed to? This is exactly why Carmack didn't put this crap in Doom III because he wanted 100% mathmatical equivilence.
 
jon_k said:
Honestly the quality dosen't look that different, but if you are paying the big $$$ for a good video card, why wouldn't you want the game looking exactly like it is supposed to? This is exactly why Carmack didn't put this crap in Doom III because he wanted 100% mathmatical equivilence.

You should be more worried about whether this degrades quality rather than the fact it is different or not. Carmack's decision didn't have as much to do with quality as it did with the fact he wanted the surfaces in all the paths to rendered in the same way. If this as some note looks better, I can't see an arguement for saying you dont want the game to look and run better, but exactly how Carmack made it.
 
i take it that all of you complaining about that the game look a little different have your monitors perfectly calibrated.

if jc was so worried about that the game looked the same on every system im sure he would have tossed in a hardware calibrator in the doom box
 
Spank said:
i take it that all of you complaining about that the game look a little different have your monitors perfectly calibrated.

if jc was so worried about that the game looked the same on every system im sure he would have tossed in a hardware calibrator in the doom box

lol...true...from the interview at b3d I got the impression that he totally didn't give a shit...just said why he did it and that was that...
 
tranCendenZ said:
Personally I think the tweak is fine, just the way it was released was unprofessional and almost seemed like a PR stunt. Humus has easy private access to Carmack and id Software due to his employment at ATI, there was no reason to criticize Carmack's code publically and release a public "fix" on a forum when he could have easily talked to Carmack directly through private channels about the code change due to his position at ATI.

who gives a shit why/how he did it? All I care about is that he made an improvement. Give the guy props and move on.
 
creedAMD said:
who gives a shit why/how he did it? All I care about is that he made an improvement. Give the guy props and move on.

You have to admit...his first post was a little out of control given the circumstances at that time...
 
^eMpTy^ said:
You have to admit...his first post was a little out of control given the circumstances at that time...

no one's perfect, I'm sure he learned from his mistake. He's not known for being a PR guy anyway.
 
I will add one more thing, then exit this thread before it becomes a waste of time to read.

MOST of the people that have a problem with this hack would be congratulating humus if he had done it for the other company, and would be rubbing it in everyone's nose that they could. Just food for thought.. out.
 
well, having seen some of the artifacts some people have gotten with this hack using high quality, I wouldn't use it onmy card for the 5fps or so people seem to be getting from it. The specular clipping in some of the screen shots looks pretty nasty. That's jsut my opinion ont he quality. My opinion on people using it is that if it doesn't bug you, don't worry what other people think.

Of course the same ATI crowd that shot fire out their ass when NVIDIA did the same basic things in their drivers now seems to have no propblem with it on ATI hardware. Which I welcome as concrete evidence that people who want to have a holy war about morality of software algorithms need to get a life.
 
creedAMD said:
I will add one more thing, then exit this thread before it becomes a waste of time to read.

MOST of the people that have a problem with this hack would be congratulating humus if he had done it for the other company, and would be rubbing it in everyone's nose that they could. Just food for thought.. out.

Plus he would have earned JC devotion for doing it...
 
raz-0 said:
well, having seen some of the artifacts some people have gotten with this hack using high quality, I wouldn't use it onmy card for the 5fps or so people seem to be getting from it. The specular clipping in some of the screen shots looks pretty nasty. That's jsut my opinion ont he quality. My opinion on people using it is that if it doesn't bug you, don't worry what other people think.

Of course the same ATI crowd that shot fire out their ass when NVIDIA did the same basic things in their drivers now seems to have no propblem with it on ATI hardware. Which I welcome as concrete evidence that people who want to have a holy war about morality of software algorithms need to get a life.



a modder is doing it..NOT ATI

now even carmack agrees it is perfectly respectable..so what is your gripe anyway?
 
raz-0 said:
well, having seen some of the artifacts some people have gotten with this hack using high quality, I wouldn't use it onmy card for the 5fps or so people seem to be getting from it. The specular clipping in some of the screen shots looks pretty nasty.
I don't think the last Humus hack causes artifacts, it's just doing less work. As I quoted Carmack above, the math needed to do what's actually in the specular table (texture) runs slower than the lookup. The reason the hack is faster is because the nicer looking specular is replaced with a simpler single operation, and that's also why it looks different.

I don't see much clipping in that screenshot: a few too bright dots here and there, nothing major. It was much worse as a POW function instead of MAD_SAT. That was my whole point. It looks OK by itself, but it's not giving the same results.
 
I just want to point out a few things....

The original poster didn't state which version of the Hack he used (it has been updated).

The original poster did not state which values he used with the hack.... 5.0, -4.0.... 3.0, -2.0.... Something else (assuming the newest version of the hack here, but relevant with the old one too).

Since those values help set the brightness of lighting effects in the hack it seems to me that the exact details of his settings would be important to know. Also testing without trying other settings is taking a great opportunity and wasting it. Instead of contributing to the hack and helping others he is merely being negative.

Also I want to point out that any discussion of POW functions is irrelevant because there is no POW function in the hack (anymore).

Also many people still seem to have seen the results of the early version (POW) of the hack and now still talk about the hack like those results are relevant, which they aren't.

Finally, considering all the complaints about how dark this game is you would think someone who's come up with a way to make the effect of lights a little brighter but not too-much so, would be lauded instead of reviled. But then !!!!!!'s will be !!!!!!'s.
 
First off I'd like to say Humus is the MAN!

Yea, I would like to know what version of the hack he used in the mouseover. The tweaked version looks better then the org. version, IMO...
 
theelviscerator said:
a modder is doing it..NOT ATI

now even carmack agrees it is perfectly respectable..so what is your gripe anyway?

That modder works for ATI developing ATI product.
 
arentol said:
I just want to point out a few things....

The original poster didn't state which version of the Hack he used (it has been updated).
...
But then !!!!!!'s will be !!!!!!'s.
I "hid" that information in the very first line of the post "I made comparisons from the static scene playdemo shot_demo001 using both the default shader and last Humus replacement." :p

I've been following the Beyond3D thread from the beginning and as of the time I made the post it was the last revision. It has not been updated today. The current hack is still the one Humus posted on page 15 of that thread.

The personal insult was uncalled for.
 
raz-0 said:
That modder works for ATI developing ATI product.
Just because he works for them doesn't mean ATI told him to do it. He makes OpenGL and D3D demos all the time, and just wanted to help us ATI card owners run Doom3 better. So he used his free time and helped us out. I don't see why everyone is making a huge deal over it, he was just trying to help out.

It even says in his sig, "I speak for myself and not for my employer. Contact PR department for official statements."
 
iLLestOne said:
Just because he works for them doesn't mean ATI told him to do it. He make OpenGL and D3D demos all the time, and just wanted to help us ATI card owners run Doom3 better. So he used his free time and helped us out. I don't see why everyone is making a huge deal over it, he was just trying to help out.

It even says in his sig, "I speak for myself and not for my employer. Contact PR department for official statements."
Quoted for the fucking truth. Everyone who is bitching owns a fucking NVIDIA card, oh the irony. Please, unless you have something constructive to add (and you know who you are) please just shut up and click the big red X in the upper right hand corner because everyone is sick of your shit! :mad: You post the same crap in every thread "OH waaaaaaaaaaaa Humus released this publicly on the net!" Who fucking cares? Does it affect you? Does it make your NVIDIA card slower or your Doom 3 experience worse? No! Carry on with your lives :rolleyes:

</rant>
 
Rizen said:
Quoted for the fucking truth. Everyone who is bitching owns a fucking NVIDIA card, oh the irony. Please, unless you have something constructive to add (and you know who you are) please just shut up and click the big red X in the upper right hand corner because everyone is sick of your shit! :mad: You post the same crap in every thread "OH waaaaaaaaaaaa Humus released this publicly on the net!" Who fucking cares? Does it affect you? Does it make your NVIDIA card slower or your Doom 3 experience worse? No! Carry on with your lives :rolleyes:

</rant>

In the beginning I was seriously annoyed with this whole thing...but now that the artifacts are gone...the 40% rumor has been done away with and the whole situation is better understood, there's not really anything to be upset about...

I maintain that this is an issue with ATi drivers going crazy when anistropic filtering is forced in the driver...if you didn't force it in the driver, it's not going to help you too much...but if you did force AF, then this seems to be a nice little patch to tide you over till ATi can get the fix into a driver release....
 
It looks like Carmack is willing to change the texture lookup to shader code instead:

"The lookup table is constant in Doom, so there isn't any real strong argument against replacing it with code. The lookup table was faster than doing the exact sequence of math ops that the table encodes, but I can certainly believe that a single power function is faster than the table lookup."

But I don't think that's what some of the posters in this thread want. They prefer the faster and different Humus specular hack instead of the improved quality specular Carmack spent time making for the game:

"It should be noted that a power function is a strictly empirical approximation of a surface's specular response, so other specular approximations shouldn't be looked at as just approximating a power function. For instance, especially for broad highlights, it is nice to have a finite cutoff angle, rather than the power limit approach."

This is posted earlier in the thread, but I don't know if anyone read it. At least it seems like that from the responses in this thread. :p
 
I see Humus as the good old fashioned hacker (and I mean in a good positive way)

A guy who can take apart a piece of code, examine it logically, and find a quick and painless way to get better performance without sacrificing anything else. People like him are rare, Nvidia or Microsoft would be very lucky to have a guy like him.

The way I understand this hack to work is not so much that forces a specific specular value, but it allows Carmacks engine to use ATI's hardware AF (instead of what he was using for AF, which essentially boils down to a software AF implementation.) That is where people are seeing the 40 percent increases. I was wondering why ATi's AF/AA was so weak... If done in hardware it should always be about the same performance dip across any game.
 
ZenOps said:
I see Humus as the good old fashioned hacker (and I mean in a good positive way)

A guy who can take apart a piece of code, examine it logically, and find a quick and painless way to get better performance without sacrificing anything else. People like him are rare, Nvidia or Microsoft would be very lucky to have a guy like him.
I said about the same thing in the other thread. Ignoring his sometimes grating presentation, he's pretty good at what he does: being driven to do things that others assume aren't possible. He gets a little carried away sometimes, but getting worked up over that doesn't make sense. I'm a programmer (but not shaders/graphics) and I have learned lots from reading his and some other poster's messages at B3D.

I'm glad Reverend/crew finally posted the Carmack replies on Beyond3D. It cleared up the whole situation and his purpose for using the texture lookup. Now if more people would just read it...
 
ZenOps said:
...
The way I understand this hack to work is not so much that forces a specific specular value, but it allows Carmacks engine to use ATI's hardware AF (instead of what he was using for AF, which essentially boils down to a software AF implementation.) That is where people are seeing the 40 percent increases. I was wondering why ATi's AF/AA was so weak... If done in hardware it should always be about the same performance dip across any game.

Umm.. not really, see my explanation thread of what exactly is happening here

Edit: I'm not detracting from Humus, just clarifying exactly how this works, so everyone can understand it. Seems like lots of the animosity in here is just from people's lack of understanding of the effect of the change and why it helps.
 
eXzite said:
Umm.. not really, see my explanation thread of what exactly is happening here
err, i don't see any analysis.

Carmack says he can make shader code that gives the same values as in the specular table (texture), but that the code is slower than a lookup. And also how he isn't surprised that a single function is faster than the lookup. The reason he said he used the table is for 1) speed reasons and 2) because:

The specular function in Doom isn't a power function, it is a series of clamped biases and squares that looks something like a power function, which is all that could be done on earlier hardware without fragment programs. Because all the artwork and levels had been done with that particular function, we thought it best to mimic it exactly when we got fragment program capable hardware. If I had known how much longer Doom was going to take to ship from that time, I might have considered differently.

and

It should be noted that a power function is a strictly empirical approximation of a surface's specular response, so other specular approximations shouldn't be looked at as just approximating a power function. For instance, especially for broad highlights, it is nice to have a finite cutoff angle, rather than the power limit approach.

He chose to use a nicer looking table for specular values than a simple function (which does look OK as I mentioned a couple of times above), and he might have done it differently "If I had known how much longer Doom was going to take to ship from that time, ...".

That still doesn't mean he would have used a simpler operation for specular, he obviously chose to do what he did for quality reasons he listed in the interview.
 
pxc said:
err, i don't see any analysis.

Carmack says he can make shader code that gives the same values as in the specular table (texture), but that the code is slower than a lookup. And also how he isn't surprised that a single function is faster than the lookup. The reason he said he used the table is for 1) speed reasons and 2) because:



and



He chose to use a nicer looking table for specular values than a simple function (which does look OK as I mentioned a couple of times above), and he might have done it differently "If I had known how much longer Doom was going to take to ship from that time, ...".

That still doesn't mean he would have used a simpler operation for specular, he obviously chose to do what he did for quality reasons he listed in the interview.


The problem is this function will not work on cards with no fargement shader support! so any card that doesn't have sm 2.0 is screwed. That is why he is not using it and won't put it in. Fragment shaders didn't appear in cards till the fx line and 9800 lines.
 
Back
Top