//flex table opened by JP

Click to See Complete Forum and Search --> : How To: Boost Doom 3 performance 40% on ATi


Bigjakkstaffa
08-08-2004, 12:01 PM
http://www.beyond3d.com/forum/viewtopic.php?t=14874&postdays=0&postorder=asc&start=0



Humus does it again


Thanks to Kombatant for showing me this thread posted by Humus on Beyond3d it makes for interesting reading indeed. I can verify it works as ive deinstalled Doom long ago but its worth checking out.

First, open your doom3\base folder. Doubleclick on the pak000.pk4 file. In the "window can't open this file .. .bla bla" dialog, go on and associate the file with an app like WinRar. With this file open in WinRar, go to the glprogs directory in the file. In there you'll find the shaders. The interaction.vfp file seems to be the main rendering shader. Altering this shader to output a constant color turns most objects into that constant color, except for stuff like computer screens etc.

So doubleclick the interaction.vfp file to open it (you may have to associate the .vfp extension with a text editor like notepad or wordpad first since we're going to edit the file). Scroll down to the fragment shader. You'll find these rows:

Code:
PARAM subOne = { -1, -1, -1, -1 };
PARAM scaleTwo = { 2, 2, 2, 2 };

Add this right below them:

Code:
PARAM specExp = { 16, 0, 0, 0 };

Now scroll down to this:

Code:
# perform a dependent table read for the specular falloff
TEX R1, specular, texture[6], 2D;

Comment out that line by adding a "#" to it, and add another line that will do the same thing with math instead, so it should look like this:

Code:
# perform a dependent table read for the specular falloff
# TEX R1, specular, texture[6], 2D;
POW R1, specular.x, specExp.x;

Save the file and close your text editor. WinRar will ask if you want to update the file in the archive, select yes. Close WinRar and enjoy about 40% higher performance in Doom3. Haven't done extensive testing yet, but my performance went from 34fps in 1280x1024 to 48fps.


NB: For anyone having problems with lighting, shimmering edges etc, try setting the following line:

PARAM specExp = { 16, 0, 0, 0 };

to 12 or 8 instead of 16

--Jakk:t

Bigjakkstaffa
08-08-2004, 12:09 PM
he also added the following info:

Another thing you may want to experiment with is post-filter renormalization of the bumpmap. I noticed the shader doesn't do that.

After this code,
Code:

TEX localNormal, fragment.texcoord[1], texture[1], 2D;
MOV localNormal.x, localNormal.a;
MAD localNormal, localNormal, scaleTwo, subOne;


add this,
Code:

DP3 localNormal.w, localNormal, localNormal;
RSQ localNormal.w, localNormal.w;
MUL localNormal, localNormal, localNormal.w;



This comes at a small performance cost and with a bit more aliasing,

Apparently the above tweaks work best for those using the Beta 4.9 driver and actually improve IQ in the process

(I'm gonan try em in a moment myself)

--Jakk:t

MJCfromCT
08-08-2004, 12:44 PM
Jakk,

Do let us know how this tweak works...I'm running omega drivers right now, do you think that this tweak will still be beneficial, or moreso just for the 4.9 drivers?

Bigjakkstaffa
08-08-2004, 12:58 PM
Seems to have given me a couple of FPS, but nothing earth shattering. Many are reporting up to ~5FPS while X800 users are reporting really big gains.

The code adjustment doesnt seem to be quite perfect yet, Demirug has offered the following adjustments to fix any possibel visual side-effects:

http://www.forum-3dcenter.org/vbulletin/showpost.php?p=2110574&postcount=26

--Jakk:t

PacNW CE
08-09-2004, 01:00 PM
I get that the x800 is the ATI flagship, but how about some improvements for the little people with R3xx? Or is that physically impossible given the older architecture?

Bigjakkstaffa
08-09-2004, 01:31 PM
Humus has been in contact with John Carmack and as a result has updated his code, the following is regarded as the final release of the tweak and appears to have squeezed up to a furthur 20% performance out while fixing vitually all artifacts.

I'm off to try this myself, enjoy:

http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar

(I say virtually all artifacts, only one person has had problems with the updated code and they were fixed with the following line:

MAD_SAT R1, specular, 4.0, -2.0;
to
MAD_SAT R1, specular, 3.0, -2.0;)

--Jakk:t

Bigjakkstaffa
08-09-2004, 01:43 PM
Again, no noticable gains for me, though my system doesnt seem very representative of Doom 3 tweaks, as non of the "Uber-tweaks" to date have given me any increases, that said, i am running faster than average fir my system though

Most people out there seem to be gettign some form of joy out of this tweak, so by all means give it a try, just remember to backup your original files though

--Jakk:t

CrazyCrusher
08-09-2004, 11:28 PM
Jakks that download u posted is this all you need for the tweaks, or do I have to manually go into the files and custom them my self?.

CrazyCrusher
08-10-2004, 12:15 AM
wow, what can I say, it works will

1024X768 on Med, 50's
1024X768 on High, 49,s
1024X768 on Ultra 47,s

not bad at all.

anyone else see an improvement?

Someone Stupid
08-10-2004, 12:31 AM
CC, what card do you have? Most R3xx users are reporting no gains (and after seeing how picky my copy of Doom is, I'm leaving this one alone until I see some real gains). I take it you have an X800?

I love how Carmack helped out and was rather easily able to further optimize the tweak (like he already knew the what the settings should be), and it is only a couple minor little tweaks and ATi cards run rather well. This was such a simple fix for x800 users that it almost seems like it was done on purpose, and Carmack isn't happy with ATi for the most part. I'm guessing some of this will be in the first patch as to what has been discovered already as the gains for those who shelled out good money have been quite good. Just don't like how it somehow made it out the door with a few simple and apparently known tweaks to help performance and even IQ tossed for ATi.

tasty danish
08-10-2004, 06:24 AM
just did it and noticed a solid 6-8fps increase.
i do have one question:
jakk where did you get the link for that version of the code?
am i just not far enough into the thread?
also, will it benefit from demirung's suggestions is was this made with that in mind?

Bigjakkstaffa
08-10-2004, 08:22 AM
The final version of the code, no extras needed can be found here:

http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar

--Jakk:t

CrazyCrusher
08-10-2004, 12:01 PM
let me fix my above setting for ultra I thought i set it but I didn’t bummer :(, it dropped right down to 34 really choppy but on my 2nd run of timedemo I jumped up to 51 on Med and stayed in the low 48's on high, I’m running 9800Pro Oc Core 423 memory 721 stays pretty solid. In all I gained just about 7 to 8 FPS.

Jakks does that final version have anything Different than your Above download post?

Bigjakkstaffa
08-10-2004, 12:22 PM
No, its a reiteration for the hard of reading

--Jakk:t

RamonGTP
08-10-2004, 03:25 PM
CrazyCrusher, I thought there was something odd with your previous numbers. To drop only 1 or 2 fps between those different settings seemed strange.

I can't say for sure if I noticed a difference becuase I didn't do a direct comparison. After doing the tweak and running the game with fraps, it seemed that my FPS was higher than before, but I don't know for sure, or if its just a mental thing.

CrazyCrusher
08-10-2004, 10:38 PM
ye, I ran a bench b4 well many times before, Id been playing round with settings a little, the only problem I had was the artifacts I then changed it to what jakks posted that kind of fixed the problem. I will still get a small amount of problems but not as much as I did. This may be due to my overclocked Pro.

Bigjakkstaffa
08-11-2004, 07:00 AM
Humus has updated the code again:

http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar

--Jakk:t

Bigjakkstaffa
08-11-2004, 04:28 PM
Some are suggesting that Humus' tweak is only noticable for those forcing AA/AF via the control panel. As a sidenote, you should try setting both of these options to "Application Preference" as Doom III's inbuilt AF runs markedly faster than forcing it on in the ATi control panel.

(Doom 3's high quality sets in-game AF to 8x and is markedly faster than me forcing 8xPerformance AF in the control panel, with no IQ loss to boot)

--Jakk:t

CrazyCrusher
08-12-2004, 01:15 AM
Jakks I just edited my old vpn file to the new to the new you posted and I did see a pretty good improvement, not a huge gain in FPS about 2 if any, but when I did overclock my card it didn’t chop any at all, I couldn’t really overclock without the choppy until I added that updated Humus file, don’t know if its luck or that but it works better for me.

widget2003
08-17-2004, 10:26 AM
hey just want to report back on the tweaks for doom 3. well we did the tweak thing from humus and noticed about 4-5 frames better on the GexCube 9600XT Xtreme vid card and also did the unpacking of the .pk4 files and noticed the game booted up faster but actual load times for each stage wern't noticably faster. and also we started to play @ 1152x864 and found ourselves playing at about 15-40 fps which was kinda playable but then lowered it to 1024x768 and now playing @ 25 - 60 fps which i think on that card is pretty impressive, without overclocking it i might add. Lowering the resolution by that small amount gave us a much more playable game without it lossing it's good looks i guess you can say