Doom3 ATI Performance Fix (avg 40% increase!)

Forums 

Well it seems if you alter a shader to output a constant color, it turns most objects into that constant color, except for stuff like computer screens etc. and produces up to 40% performance increase on ATI cards! Guys 'n Gals, i've tried this and it really does make a hell of a diference!

Ok i'll explain how to do it, as well as offer the download for those of you that cant be bothered doing it!!

Download and extract to ' \Doom3\Base\ '
http://esprit.campus.luth.se/~humus/temp/doom3PerformanceTweak.rar

Website URL:
http://www.beyond3d.com/forum/viewtopic.php?t=14874

Manual Instructions:
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.

There you have it, you ATI folk!

rather lenghty but thnx!
Dont suppose a similar solution can work with other games?

lenghty instructions, yes, but download and extract the RAR and you don't have to do anything else! :)

As for other games, i shouldn't think this would be possible.. mainly for one reason. Its simply amazing that the shader source itself is raw within the game!! Ok so its packed in a file, but the point of the matter is any avg, joe can view the code and alter it..... Now i'm assuming this has been done because of the VERY open invitation to mod the game.. so the source is ready got at for ease.

So if another title has various bits of code open source, then yes it might be possible, but i wouldn't expect so.

If your thinking of Half Life 2, well the doom 3 engine and valve's "source" engine render in two COMPLETELY diferent ways, so I doubt it will be as easy/ obvious.

On the plus side, this little gem has started a whole load of people over at Beyond3D.com routing around the doom3 source to look for any other little perforance loop holes.. so should get better and better!!!!

All credit to Humus @ http://esprit.campus.luth.se/~humus/ for the original info and work on the shader code. :)