Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Gaming


 
 
LinkBack Thread Tools
Old 08-11-2004, 12:04 PM   #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.
dun_ask is offline  
Old 08-11-2004, 12:21 PM   #2 (permalink)
alpaca lunch for the trip
 
jujueye's Avatar
 
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.
jujueye is offline  
Old 08-11-2004, 03:35 PM   #3 (permalink)
Xepidemic
Guest
 
i tried humus tweak. it definately seems faster. even the menu seems faster. but does it degrade the visual quality a little? it looked like it did.
 
Old 08-11-2004, 09:24 PM   #4 (permalink)
Psycho
 
Quote:
Originally posted by Xepidemic
i tried humus tweak. it definately seems faster. even the menu seems faster. but does it degrade the visual quality a little? it looked like it did.
It might have, but the only difference is the gamma is up a little. Not much of a difference. Game on!

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..
dun_ask is offline  
Old 08-11-2004, 09:30 PM   #5 (permalink)
Psycho
 
nvm
dun_ask is offline  
Old 08-11-2004, 09:39 PM   #6 (permalink)
alpaca lunch for the trip
 
jujueye's Avatar
 
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 *********************************************
jujueye is offline  
Old 08-12-2004, 03:49 PM   #7 (permalink)
Lost!!
 
Scorps's Avatar
 
Location: Kingston, Ontario
I got Doom3 running awesome and I got a ATI card (Radeon 9700 Pro) And I didn't have to change anything!
__________________
A.K.A. PainTrain
Scorps is offline  
Old 08-13-2004, 12:01 AM   #8 (permalink)
Delicious
 
Reese's Avatar
 
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
Reese is offline  
Old 08-13-2004, 08:07 AM   #9 (permalink)
Lost!!
 
Scorps's Avatar
 
Location: Kingston, Ontario
Quote:
Originally posted by cybermike
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.
Man shadows is everthing....I have seen things coming because of shawdows....you might want to get something fast for your comp!
__________________
A.K.A. PainTrain
Scorps is offline  
Old 08-14-2004, 11:53 AM   #10 (permalink)
Delicious
 
Reese's Avatar
 
I can run shadows fine, but the Autoexec posted above disables them. It adds about 7 FPS but I'd rather run at 34fps with shadows instead of 41 without.
__________________
“It is better to be rich and healthy than poor and sick” - Dave Barry
Reese is offline  
Old 08-14-2004, 01:26 PM   #11 (permalink)
I'm a pepper bitch..
 
NeverBorn's Avatar
 
oh hey, thanks
NeverBorn is offline  
Old 08-14-2004, 07:09 PM   #12 (permalink)
Upright
 
have you guys tried the 4.9 beta catalyst drivers that ATI have released?
supposed to increase performance in doom3 by heaps with any ATI card
hellkite is offline  
Old 08-15-2004, 11:25 PM   #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
dauvin is offline  
Old 08-16-2004, 12:55 AM   #14 (permalink)
Upright
 
p4 2.8
mobility radeon 9700 pro -> tweaked drivers
512mb dual-channel ddr


running 800x600, high, avg fps of 35.

Just tried extracting all pk4's, will try now.
miketh is offline  
Old 08-16-2004, 06:16 PM   #15 (permalink)
Psycho
 
extracting the pk4 files are good, but when it comes time to update your Doom..all I have to say is..GOOD LUCK. ^_^
dun_ask is offline  
Old 08-18-2004, 12:07 PM   #16 (permalink)
alpaca lunch for the trip
 
jujueye's Avatar
 
Location: in my computer
Quote:
Originally Posted by cybermike
I can run shadows fine, but the Autoexec posted above disables them. It adds about 7 FPS but I'd rather run at 34fps with shadows instead of 41 without.
Yeah, I spotted that myself. And seriously, the shadows are so amazing that it really is worth it to leave them working. I often don't use the autoexec.

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.
jujueye is offline  
 

Tags
ati, boost, cards, doom, performance


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 08:54 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360