Welcome, Guest. Please Login 3dfx Archive
 
  HomeHelpSearchLogin  
 
Pages: 1 2 3 
Send Topic Print
Doom3... well it rocks. (Read 953 times)
paulpsomiadis
God Member
*****
Offline


-=3Dfx still rox!=-

Posts: 2011
Newcastle U.K.
Gender: male
Re: Doom3... well it rocks.
Reply #30 - 31.08.04 at 06:27:06
 
People running DOOM3 on a Radeon card might also want to try this little tutorial from the Beyond3D forums...

I've re-posted it here for convenience: -

Quote:
Beyond3D Forums Shader Patch

Quick guide for those who don't want to read the full thread.

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

Extract so that the shader file goes under doom3\base\glprogs. This replaces a dependent texture read with equivalent math, which runs better on ATI cards, but seems to run slower on NV boards, so only apply this if you got an ATI card.


--------------------------------------------------------------------------------
----



I picked up Doom3 today and let be begin by saying it's a kickass game so far.  A few minuses like weapon reload (which I find add nothing to a game, except annoyance, so I don't know why many devs keep adding it to their games), but overall much above my expectations.

Anyway, to the fun part, exploring the technology. 
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.
Back to top
 

-=To MOD or not to MOD, that is a DUMB question - just MOD it!=-&&&&+May God stand between you and harm in all the empty places you must walk.+
themadhaxor  
IP Logged
 
voodoo5500
Full Member
***
Offline


Proud 3dfx gamer

Posts: 197
Canada
Gender: male
Re: Doom3... well it rocks.
Reply #31 - 08.09.04 at 02:19:44
 
@paulpsomiadis,


have you tried the above tweak, if yes what was your fps gain ?

I have read some post's on ati related sites with people reporting nice performance improvements and others stating it introduced some graphical error's  Undecided

Back to top
 

Voodoo 5500 agp&&3dfx 1.04&&Windows 98 SE&&ECS K7S5A Pro&&Athlon XP 2600+&&512 mb&&SB Live! Platinum
 
IP Logged
 
voodoo5500
Full Member
***
Offline


Proud 3dfx gamer

Posts: 197
Canada
Gender: male
Re: Doom3... well it rocks.
Reply #32 - 08.09.04 at 13:50:04
 
@paulpsomiadis,

Disregard my post above, curiousity got the better of me, so I backed up the file (just in case), applied the patch and have gotten fantastic results (32 fps avg. before, 40 fps avg. after)  Grin
Back to top
 

Voodoo 5500 agp&&3dfx 1.04&&Windows 98 SE&&ECS K7S5A Pro&&Athlon XP 2600+&&512 mb&&SB Live! Platinum
 
IP Logged
 
DenisF
Senior Member
****
Offline


So fluffy it hurts

Posts: 409
Israel
Gender: male
Re: Doom3... well it rocks.
Reply #33 - 08.09.04 at 15:24:35
 
I'm scared, hold me Cry
Back to top
 

[
Powered By:
]
[
Abit NF7-S Rev2.0
] [
AMD Athlon-XP Mobile 2600+@200x12 1.7v
]&&[
GeiL Golden Dragon PC3200 512mB Dual Channel Kit
] [
ATi Radeon 9700 PRO 128mB
]
&&...
138674373 denisfak  
IP Logged
 
Pages: 1 2 3 
Send Topic Print