How to boost your Doom3 performance by 40% on ATI hardware

Discussion in 'PC Gaming' started by Humus, Aug 8, 2004.

  1. Clockwork

    Newcomer

    Joined:
    Feb 21, 2004
    Messages:
    76
    Likes Received:
    0
    Location:
    Wisconsin
    This is completely unrelated to Humus's tweak. AF is not affected.

    When Doom 3 is allowed to set the AF level (and control panel is set to application preference) the lines separating mip levels are clearly visible akin to the kind of thing you would see with bilinear filtering instead of the blending between levels you would get with trilinear.

    When you force AF through the driver control panel, the mip levels are blended properly.


    This is the case with or without the tweak, but it has left me curious. There was a thread about this at Rage3d before the tweak ever came out.
     
  2. digitalwanderer

    digitalwanderer Dangerously Mirthful
    Legend

    Joined:
    Feb 19, 2002
    Messages:
    18,992
    Likes Received:
    3,532
    Location:
    Winfield, IN USA
    Re: HUMUS

    Oh, allow me. 8)

    [​IMG] [​IMG]

    Although I think [​IMG] [​IMG] [​IMG] [​IMG] [​IMG] work too.

    Of course, I think [​IMG] is appropriate too. 8)
     
  3. daerBaer

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    12
    Likes Received:
    0
     
  4. junkheap

    Newcomer

    Joined:
    May 28, 2003
    Messages:
    67
    Likes Received:
    0
    Re: HUMUS

     
  5. breez

    Regular

    Joined:
    Aug 13, 2002
    Messages:
    270
    Likes Received:
    1
    Location:
    Finland
    OK, I checked mipmap lines with app.pref/forced and Humus/no-Humus. With Humus' tweak I can now play with force 8xAF with no mipmap lines and good fps. Using 4.9beta.
     
  6. Demirug

    Veteran

    Joined:
    Dec 8, 2002
    Messages:
    1,326
    Likes Received:
    69
    Chris Lux (from 3dcenter) checked a frame in Doom and it looks like that it use the same specular falloff LUT for all objects.

    After analyse this texture I was able to find a identical math replacment for it. The shader have to change in the following way:

    Code:
    Old:
    # perform a dependent table read for the specular falloff
    TEX	R1, specular, texture[6], 2D;
    
    New:
    
    # perform a dependent table read for the specular falloff
    SUB_SAT R1, specular, 0.75;
    MUL     R1, R1, R1;
    MUL_SAT R1, R1, 16.0;
    In the case of a good shadercompiler in the driver this should better:

    Code:
    Old:
    # perform a dependent table read for the specular falloff
    TEX	R1, specular, texture[6], 2D;
    
    # modulate by the constant specular factor
    MUL	R1, R1, program.env[1];
    
    New:
    # perform a dependent table read for the specular falloff
    
    SUB_SAT R1.x, specular.x, 0.75;
    MUL     R1.x, R1.x, R1.x;
    MUL_SAT R1.x, R1.x, 16.0;
    
    # modulate by the constant specular factor
    MUL	R1, R1.x, program.env[1];
     
  7. SpiderWoW

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    8
    Likes Received:
    0
    for what are those specular texture maps then good for when you simply can do a calculation ?
    i assume your guess about "more accurate" is only true if the specular texture maps are generated automatically always with exactly that calculation of POW 16 and that only in NON ULTRA modes because of the compression.
     
  8. Ruined

    Regular

    Joined:
    Sep 20, 2003
    Messages:
    317
    Likes Received:
    4
    Re: Answers...

    Tried this change, framerate in timedemo dropped from ~52fps to ~45fps (6800GT stock @ 1600x1200, 8xAF), so no improvement there.
     
  9. SpiderWoW

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    8
    Likes Received:
    0
    i think the difference comes from the hardware differences - because NV rethought their hardware and relayouted it. ATI didnt.

    besides ... that hack seems to be great (long thread already), still not sure for what games are using specular texture maps then and why directx is offering that feature?
     
  10. tEd

    tEd Casual Member
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,105
    Likes Received:
    70
    Location:
    switzerland
    Maybe i've done something wrong but it looks kinda red now. :?
     
  11. emerge

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    7
    Likes Received:
    0
    Did some test runs, AthlonXP 1800+, stock speed 9600Pro, 768MB PC266, Cat4.7
    800x600 High Quality noVSync
    timedemo demo1, three runs, first discarded
    Edit: noAF was not true, DoomConfig.cfg sets to x8 on hq Edit2: now also tested 0xAF in DoomConfig.cfg
    Code:
    noAA 0xAF via DoomConfig.cfg
    TEX (normal)      MUL_SAT (humus)        Gain
       30,1               30,5                ~1.5%
       30,0               30,6                         
    
    noAA 8xAF via DoomConfig.cfg
    TEX (normal)      MUL_SAT (humus)        Gain
       27,8               28,7                ~3%
       27,7               28,6                         
    
    noAA 8xAF performance via CP
    TEX (normal)      MUL_SAT (humus)        Gain
       25,3               29,6               ~17%
       25,3               29,5                         
    
    noAA 8xAF quality via CP
    TEX (normal)      MUL_SAT (humus)        Gain
       23,9               28,3               ~18.5%
       23,9               28,4                         
    
     
  12. pksorcerer

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    9
    Likes Received:
    0
    There is no connection between so called "specular map" and the tex lookup discussed here.
    If you look closely in the shader sode you can see that the specular component is still there.
    What's changed is the way the shader calculates the light contribution of the specular component.
    Instead of table lookup it's now done with math. That's it.
     
  13. ATIpwnz

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    14
    Likes Received:
    0
    Ok where do I plug that into the interaction file? Do i just copy and paste that and insert it in the first *changes by humus* section? And which one do you use?
     
  14. FUDie

    Regular

    Joined:
    Sep 25, 2002
    Messages:
    581
    Likes Received:
    34
    Re: Answers...

    Maybe you've just broken NVIDIA's shader replacements for DOOM 3? Remember what Carmack said about "any little change causes a serious drop in performance when you fall off the fast path in NVIDIA's driver" (paraphrase obviously).

    -FUDie
     
  15. SpiderWoW

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    8
    Likes Received:
    0
    ok - then that "hack" seems to be a really good improvement/optimization for your ATI cards and i am honestly happy with you (having a NV though).
     
  16. Demirug

    Veteran

    Joined:
    Dec 8, 2002
    Messages:
    1,326
    Likes Received:
    69
    Did you use Version 1 or 2? In the case you use the second please try the first. It is possible that the second version did not work correct with every driver.
     
  17. Toasty

    Newcomer

    Joined:
    Jul 24, 2002
    Messages:
    51
    Likes Received:
    2
    Re: Answers...

    Maybe someone with an NV30/NV40 should take the default shader and reorder its' instructions. For instance, try moving the "# perform the diffuse bump mapping..." section above the "# load the specular half angle first" section. The order of these two sections will not in any way change the final result of the shader and if performance drops then this *may* indicate shader detection occuring (it may also indicate a less than stellar shader compiler in NV's driver). The same should be tried with ATI hardware. Actually I will try it on my R300 and report back.

    EDIT:
    Tried my suggested instruction reorder and incurred no performance change. This was done to the default interaction.vfp shader.
     
  18. Solr_Flare

    Newcomer

    Joined:
    Aug 9, 2004
    Messages:
    9
    Likes Received:
    0
    Ok, I did some checking here and it appears to be that, yes, AF done by the game only applies to the textures it feels needs them while AF applied from the CP applies it across the board.

    The effect the humus tweak is having is that it is allowing the ATI cards to operate more effeciently based on their hardware designs, thus allowing you to force CP based AF on the game. The side effect of this is you can now run AF at a higher level than the in game AF allows and get roughly equal performance, thus boosting image presentation.

    Now, on a different note, fanboys, please check yourselves at the door and go someplace else. It is obvious looking over the code that the design choice Carmack made was:

    To implement the shader method he felt would work most effeciently across the broadest range of cards possible. So instead of having upteen million card specific optimizations, he chose the single best one that would work across as many cards as possible.

    That is simple coding effeciency and removes the burden of having to deal with next-gen card issues(ie you remove yourself from the trap of needing to add in new optimizations for every single card release).

    It just so happens, as we are all aware in the first place, Nvidia designed their current generation of cards to ensure they got optimal performance off this game. There is nothing wrong with that, its a solid card no matter what. But, since Nvidia altered their card design based on the method Carmack used, the side effect is current generation Nvidia cards are already "optimized" in Doom 3.

    If ways are found to optimize nvidia's performance any further, I'll be all for it. This has nothing to do with one card performing better than another and competition. It has everything to do with being a technical discussion of the doom 3 shader code, figuring out how it works, and finding ways individual users can boost their performance by optimizing the code for their hardware.

    Please don't turn this into an ATI vs Nvidia fanboy war, it is anything but.
     
  19. Demirug

    Veteran

    Joined:
    Dec 8, 2002
    Messages:
    1,326
    Likes Received:
    69
    I have used the original shader but it is the same place that humus changed.
     
  20. tEd

    tEd Casual Member
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    2,105
    Likes Received:
    70
    Location:
    switzerland
    first version works
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...