![]() |
![]() |
#1 (permalink) |
Psycho
|
Doom 3 Performance Boost for ATI cards
I think I've found the source of why this game runs comparably slow on ATI hardware vs. nVidia at the moment, and found a solution to the problem.
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. Conclusion and discussion: I don't want to complain about Carmack's work, I still consider him to be the industry leader in graphics engines. Though when I read the shader it striked me how many texture accesses it did compared to the relatively short shader, even for stuff that could just as well be done with math for a small cost in instructions. Using a dependent texture lookup for POW evaluation makes a lot of sense for R200 level hardware due to instruction set limits, but for R300 and up it's much better to just spend the three cycles it takes to evaluate POW with math instead of risking texture cache trashing with a dependent texture read, which may be much more costly, especially since the access pattern in this case will be far from linear. Also, using math improves the quality too, even though it may not be very noticable in this game. I should point out though that I'm not sure if the constant specular factor 16 that I chose is the one that the game uses, so output may be slightly different, but if this solution will be worked into the game in a future patch, then this is easily configurable by the game so that there won't be a difference, except a lot faster. An interesting follow-up discussion may be why this dependent texture lookup is much slower on our hardware than on nVidia. Maybe there's an architectural difference that's to blame, or maybe something else? The main point here though is that this should be good enough proof that ATI hardware can run Doom3 just as good if not better than nVidia, and that we can pass on all the "ATI suck in OpenGL", "ATI's drivers suck" etc. into the trashcan where it belongs. -Humus I got this from here Just thought it might help out the TFP community! ![]() be sure to backup your pak000 file, you won't be able to play on PURE servers on multiplayer. |
![]() |
![]() |
#2 (permalink) |
alpaca lunch for the trip
Location: in my computer
|
hey dun, it was nice to see the great improvements on your system. However, the article you reference showed systems with only 2-14%. This looks like good stuff, though. I admire your willingness to dig directly into the code. Kudos to you!
Now, we all know that there are going to be tradeoffs, so my question is: how does it look after the change? If it looks like Quake3, then is it really worth it? I guess I really want to have my fps and a creepy, realistic look, too. Striking a balance is obviously the tough part, and I think is likely what Carmack was hoping to get. Let's face it: most people are going to play it as it was out of the box, so id needed to balance everything out for people like that. As for me, a friend sent me a cfg file that took me from 34 fps at 1024 to 42. That's pretty close to what you got!!! Here is the text from this file: // Set "image_cacheMegs" to about 1/4 of your total system RAM // Set "image_cacheMinK", using the formulas below. // // "image_cacheMegs" / 8 = n // n * 1024 = "image_cacheMinK" seta image_cacheMegs "256" seta image_cacheMinK "32768" seta image_useCache "1" seta image_downSizeLimit "512" seta image_ignoreHighQuality "1" seta image_downSizeBumpLimit "512" seta image_downSizeSpecularLimit "64" seta image_downSizeBump "1" seta image_downSizeSpecular "1" seta image_downSize "1" seta image_forceDownSize "1" seta image_lodbias "0" seta r_preload "1" seta r_skipBump "0" seta r_shadows "0" seta r_useOptimizedShadows "1" seta r_useTurboShadow "1" seta g_bloodEffects "1" seta g_decals "0" seta g_showBrass "0" seta g_muzzleFlash "1" seta g_projectileLights "1" seta g_doublevision "0" seta g_showPlayerShadow "0" seta image_anisotropy "0" seta image_filter "GL_LINEAR_MIPMAP_NEAREST" bind MOUSE3 _Speed bind "F11" "con_noprint 1; set ui_showGun 0;set g_showHud 0; wait; screenshot 4000 3000 16; set g_showHud 1; set ui_showGun 1; con_noprint 0" //exec p13_single.cfg echo ********************************************* echo Changes made. Send the Demons back to hell. echo ********************************************* Copy this and save it to a file named "autoexec.cfg" in your \\Doom 3\base directory (or wherever your DoomConfig.cfg file resides.) You'll also notice a bind for the F11 key: this will take 4000 x 3000 screenshots with 16x antialiasing. Great for some amazing wallpaper!!! Thanks for the discussion and the tip. This is why tfp is such a great place. |
![]() |
![]() |
#4 (permalink) | |
Psycho
|
Quote:
Jujueye, would I copy and paste the WHOLE thing or just some parts, not quite clear on that. Thanks for the contribution! =) Last edited by dun_ask; 08-11-2004 at 09:31 PM.. |
|
![]() |
![]() |
#6 (permalink) |
alpaca lunch for the trip
Location: in my computer
|
Cut and pat all (yes, all!!!) of the following to a file named autoexec.cfg:
// Set "image_cacheMegs" to about 1/4 of your total system RAM // Set "image_cacheMinK", using the formulas below. // // "image_cacheMegs" / 8 = n // n * 1024 = "image_cacheMinK" seta image_cacheMegs "256" seta image_cacheMinK "32768" seta image_useCache "1" seta image_downSizeLimit "512" seta image_ignoreHighQuality "1" seta image_downSizeBumpLimit "512" seta image_downSizeSpecularLimit "64" seta image_downSizeBump "1" seta image_downSizeSpecular "1" seta image_downSize "1" seta image_forceDownSize "1" seta image_lodbias "0" seta r_preload "1" seta r_skipBump "0" seta r_shadows "0" seta r_useOptimizedShadows "1" seta r_useTurboShadow "1" seta g_bloodEffects "1" seta g_decals "0" seta g_showBrass "0" seta g_muzzleFlash "1" seta g_projectileLights "1" seta g_doublevision "0" seta g_showPlayerShadow "0" seta image_anisotropy "0" seta image_filter "GL_LINEAR_MIPMAP_NEAREST" bind MOUSE3 _Speed bind "F11" "con_noprint 1; set ui_showGun 0;set g_showHud 0; wait; screenshot 4000 3000 16; set g_showHud 1; set ui_showGun 1; con_noprint 0" //exec p13_single.cfg echo ********************************************* echo Changes made. Send the Demons back to hell. echo ********************************************* |
![]() |
![]() |
#8 (permalink) |
Delicious
|
Editing the interaction.vfp added about 1fps for me which is worth it
![]() The only think the autoexec did that added any FPS was turning off shadows which I want enabled. I guess I'm just not going to get any faster.
__________________
“It is better to be rich and healthy than poor and sick” - Dave Barry |
![]() |
![]() |
#9 (permalink) | |
Lost!!
Location: Kingston, Ontario
|
Quote:
__________________
A.K.A. PainTrain |
|
![]() |
![]() |
#13 (permalink) |
Upright
|
This was kinda alluded to, but I got a performance boost by extracting all the pk4 files into the base folder then deleting the pk4s themselves.
You won't be able to join pure MP servers, but the game doesnt "stick" as much for me when I open a door or enter a new area. Playing at 1280 1024 @ high p4 2.4 Radeon 9800 pro 128 cata 4.6 512mb ddr 3200 WinXP Pro |
![]() |
![]() |
#16 (permalink) | |
alpaca lunch for the trip
Location: in my computer
|
Quote:
As for the beta drivers, I have heard they are amazing in spite of a few anomalies. They shoudl have some optimized code just for D3. I may try them tonight. |
|
![]() |
Tags |
ati, boost, cards, doom, performance |
|
|