New dynamic branching demo

Discussion in 'Architecture and Products' started by Humus, Jul 1, 2004.

  1. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    LOL, I guess that was an alternative explanation ... but it's waaaay off. No, all it demonstrates is how poor nVidia's hardware is at stencil rejection.
     
  2. 991060

    Regular

    Joined:
    Jul 29, 2003
    Messages:
    640
    Likes Received:
    2
    Location:
    Beijing
    The performance drop in NV40/NV3x is most likely due to the lack of early stencil kill ability. And I'm not criticising you, Chris, I know you're much better than that. :wink:
     
  3. Jack_Tripper

    Newcomer

    Joined:
    Sep 11, 2003
    Messages:
    180
    Likes Received:
    0
    Location:
    Asslanta
    X800XT
    *edit...whoops...didn't have AA/AF on at all...sorry*
    16*12
    ON 140
    OFF 43

    10*7
    ON 315
    OFF 106

    Jack
     
  4. digitalwanderer

    digitalwanderer Dangerously Mirthful
    Legend

    Joined:
    Feb 19, 2002
    Messages:
    18,992
    Likes Received:
    3,532
    Location:
    Winfield, IN USA
    Humus, did ATi give ya a pat-on-the-head or a bonus or anything weird like that for this? (Sorry, the cursiousity bug bit me and I had to ask.)
     
  5. trinibwoy

    trinibwoy Meh
    Legend

    Joined:
    Mar 17, 2004
    Messages:
    12,059
    Likes Received:
    3,119
    Location:
    New York
    Outside of the fact that we have the usual people hyping the ATI side of things and the usual people brandishing Nvidia's guns, like Chris Ray I am leary of the extreme difference in the impact of the optimizations on different hardware.

    I don't believe that Humus intentionally made the optimization ineffective for Nvidia hardware but I thought the optimization was supposed to be generic? Humus, being the coder you are in the best position to at least make an informed guess at a reason for the discrepancy. Any ideas?

    Also, Nvidia is a corporation that has an opportunity to take advantage of features that are unique to their product and they are doing so. The argument that it is Nvidia's 'fault' that Crytek didn't implement these new features in SM2.0 is infantile. It is actually ATI's 'fault' for not implementing SM3.0 support in the first place. Any sensible person would acknowledge that.

    Yes it is possible and feasible, but what incentive does Crytek really have to forego SM3.0 and implement fall backs for SM2.0? ATI sure as hell doesn't seem to be giving them any. So Crytek's decision is $$$+3.0 or nothing+2.0 assuming equal effort for either. Yeah, tough decision.

    Fact is, Far Cry is a completed retail game that runs perfectly on ATI hardware. Crytek would have never even added these new features without pressure/incentive from Nvidia in the first place and nobody would have seen them on either IHV's hardware. Unless some of you conspiracy theorists think that they intentionally dummied down their SM2.0 features in anticipation of the SM3.0 only addons :wink:

    The same people that were saying SM3.0 is worthless are the same ones now saying that Crytek/Nvidia are evil for using it. Where does it stop? This is getting ridiculous.
     
  6. trinibwoy

    trinibwoy Meh
    Legend

    Joined:
    Mar 17, 2004
    Messages:
    12,059
    Likes Received:
    3,119
    Location:
    New York
    Please explain who the 99.9% are and exactly how they are being screwed. I'm quite sure Far Cry will continue to run fine on all hardware that it runs on now. What does a non-NV4X/Far Cry owner lose by Crytek's add-ons?

    Do you mean that developers have some obligation to support a certain installed base of hardware for any new features they decide to add to an already complete game? By not doing so aren't they merely hurting their own sales?

    Quick poll. Will you be happier if

    a) the SM3.0 add-ons prove to be worthless and actually slow performance on NV4X.
    b) the SM3.0 add-ons are great but someone finds a way to replace the SM3.0 shaders with equivalent SM2.0 shaders and everyone can join in the fun.
     
  7. TheAlSpark

    TheAlSpark Moderator
    Moderator Legend

    Joined:
    Feb 29, 2004
    Messages:
    22,146
    Likes Received:
    8,533
    Location:
    ಠ_ಠ
    hm... well most of that 99.9% really consist of the GF4MX people, and I don't think it matters to those people as much either. :wink:

    It screws the 5xxx or R3xx/4xx people in that they will be forced to buy SM3.0 capable cards just to see shader effects that could have been done using SM2.0 (should they even care, mind you). This is assuming there is no "someone" to automagically convert SM3.0 shaders to SM2.0 shaders.

    Option b) is probably what everyone wants, ideally. It's the "replacing with SM2.0 code" that is up in the air right now, unless you're going to do it. :D
     
  8. Evildeus

    Veteran

    Joined:
    May 24, 2002
    Messages:
    2,657
    Likes Received:
    2
    Yeah, first i thought it was on topic then i went :roll:

    That's the only thing that would be interesting (apart from the pretty good boost you have ;))
     
  9. Heathen

    Regular

    Joined:
    Jul 6, 2002
    Messages:
    380
    Likes Received:
    0
    Well all I've got to say is, way to go Humus. :)

    One thing (about the demo now :wink: ) is that some of the back walls in the demo look REALLY flat. Otherwise stunning.
     
  10. Pete

    Pete Moderate Nuisance
    Moderator Legend

    Joined:
    Feb 7, 2002
    Messages:
    5,777
    Likes Received:
    1,814
    Now that I've seen the huge gains nV reaped with SM3.0 in FC v1.2 in AT's benches, I'm going to have to reread Humus' original posts on this technique. :)
     
  11. Blastman

    Newcomer

    Joined:
    Jul 15, 2003
    Messages:
    176
    Likes Received:
    2
    Are you sure about that? If the Farcry SM3.0 patch increases performance 30% -- how much of that performance increase is from actual SM3.0 code -- and not from just a general rewriting/optimizing of the shaders like NV did in Halo? NV could probably get a sizable performance increase by just rewriting the current 2.0 shaders. Marketing department -- hmmmm, that’s a nice increase -- lets market it all as a SM3.0 performance benefit.
     
  12. Richard

    Richard Mord's imaginary friend
    Veteran

    Joined:
    Jan 22, 2004
    Messages:
    3,508
    Likes Received:
    40
    Location:
    PT, EU
    Sorry, but I really don't agree with this justification. Say ATI pays valve to make all nvidia cards run in fixed-function mode. I'm sure nVidia fans would be extremelly happy by that.

    And didn't nVidia fans complain that 3Dmark03 had ATI optimisations (PS 1.4) so much that futuremark had to patch it to include a PS 1.1 fallback? Same thing here. As long as it's reasonably possible to write fallbacks developers should do it. If they don't I'll vote with my wallet. I'm waiting for DOOM 3 before I upgrade. As it stands right now, whether I end up buying a 6800 or X800 I will not be buying FarCry.

    Today might be ATI getting the shaft, tomorrow it might be nVidia. And considering xbox2, I don't want a flood of PC titles that screw nVidia fans from 2005-until xbox3.

    Humus: keep up the good work. Oh btw, I think FC uses stencil shadows in indoor parts.
     
  13. Zeno

    Newcomer

    Joined:
    Jun 4, 2003
    Messages:
    26
    Likes Received:
    0
    Location:
    San Diego, CA
    You mean the same amount of pixel-shader work, right? Obviously there's more vertex work and additional stencil buffer work.

    My biggest question about your technique: Do you need one extra pass (sending of scene to card) per 'if' statement that you wish to emulate, or can you do multiple independent 'ifs' with one pass?

    I'm really surprised that there's no performance gain from your idea on NVIDIA cards. It really should be saving some work - a stencil test should come before fragment shading unless (maybe) you modify depth values in your fragment shader? Anyway, I'd like to look into it this weekend if I have time.
     
  14. Evildeus

    Veteran

    Joined:
    May 24, 2002
    Messages:
    2,657
    Likes Received:
    2
    If i was paranoaic, i would say there's a corelation between the release of the demo and the SM3.0 test @ Anand :lol:

    More seriously, hope you can do something zeno ;). I would really like to see the difference between this tech and PS3.0.
     
  15. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,400
    Likes Received:
    440
    Location:
    San Francisco
    Weird..I know for sure NV2A performs an early stencil test..so I would expect NV30/40 to have it.
    Too bad I own a 9800pro..so I can't test it ;)

    ciao,
    Marco
     
  16. snakejoe

    Newcomer

    Joined:
    Apr 27, 2004
    Messages:
    51
    Likes Received:
    3
    No, It dosent.
    http://www.3dcenter.de/artikel/2003/03-05_english.php

     
  17. Sigma

    Newcomer

    Joined:
    Jul 2, 2004
    Messages:
    88
    Likes Received:
    0
    Location:
    Portugal
    This is a demo about what? Of anything is about a stencil hack of a multipass technique to emulate branching of any shader model available on earth (not just PS3.0).

    The thing is: it is a stencil hack -> useless. Everyone knows about this, just like eveyone knows for example that a RenderMan shader can be broken down on every hardware with PS1.1 capabilities (not regarding precision of course).

    Since the stencil gets used, it is impossible to have stencil shadows on the scene... And what developer would have the trouble of writting a multipass tecnhique using stencil when he could just write an "if". Is like saying that a scene with a single light with PS1.0 supports HDRI: of course it does, it uses one light, so it doesn't overbright...

    And haven't you heard? NVIDIA know supports 3Dc. Really, really. It simply doesn't compress the texture. And that means even better quality than ATI, althought I think NVIDIA implementation maybe by slower... :roll:

    The demo is great, aka Humus style. What I enjoyed is the change in speach, like "Nvidia can consider themselves pwned." when he knows perfecly well that this isn't a replacement for dynamic branching.
    Another thing I would like to know Humus is why did you forget to implement any kind of occlusition to the part where it uses branching. That does shift the results a lot because the stencil is the "occlustion"...

    EDIT: yah, that is right: I registered just to post this... 8)
     
  18. Evildeus

    Veteran

    Joined:
    May 24, 2002
    Messages:
    2,657
    Likes Received:
    2
    Welcome Sigma 8)
     
  19. Xmas

    Xmas Porous
    Veteran Subscriber

    Joined:
    Feb 6, 2002
    Messages:
    3,344
    Likes Received:
    176
    Location:
    On the path to wisdom
    Where do you read that? He talks about "not marketing" - which btw has changed in the meantime.
     
  20. _arsil

    Newcomer

    Joined:
    Mar 7, 2003
    Messages:
    11
    Likes Received:
    0
    That only means, that they are not marketing it!

    As far as I know, both ATI and Nvidia perform Z and stencil buffer tests before pixel shader. And I observed this behaviour many times writing my own shaders on both cards (NV3x and R3xx). In some situations early tests are impossible, e.g. writing Z value in pixel shaders.


    And about technique.. As wrote in far cry ps3 and stuff topic:
    - It requiress as many passes as there are paths in the shader
    - It doesn't work with transparent triangles and some blending modes
    - It wastes cycles in many cases because some computations must be duplicated in every path.
     
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...