Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Is the if-statement particularly slow ?

  1. #11
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Is the if-statement particularly slow ?

    The GeForce FX series isn't able to do dynamic branching in pixel shaders.
    For the sake of clarification, the GeForce FX 6800 is still an FX, and it can do dynamic branching in the fragment program. What he really means is that 5xxx cards can't do fragment program branching.

  2. #12
    Junior Member Regular Contributor
    Join Date
    Apr 2003
    Location
    France
    Posts
    114

    Re: Is the if-statement particularly slow ?

    Hi again,

    Now that i had some time to look at it, i'd like to get some precision. I'm quiet a beginner so dont hesitate to explain to me like you would to a kid =)

    So here are the steps :

    1 - We render our first pass with depthAmbiant shader ON, rendering for shadowed aeras

    2 - XXXX

    3 - Finally we do our second pass with lighting shader ON only where stencil value says, so that lit fragments are actually lit.

    That's the second step i'm missing :

    the if shader return as a color param the distance from the light to the fragment.
    And i know thats when the stencil buffer decide whether a fragment is lit or not, but i dont get how.

    thx to anyone
    wizzo
    You snooze, you loose

  3. #13
    Junior Member Newbie
    Join Date
    Apr 2004
    Posts
    11

    Re: Is the if-statement particularly slow ?

    Korval: It's the GeForce 6800; no "FX". FX <=> 5xxx. </nitpick>

  4. #14
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Is the if-statement particularly slow ?

    Korval: It's the GeForce 6800; no "FX". FX <=> 5xxx. </nitpick>
    Hmmm. I could have sworn I checked that before posting it. Oh well.

  5. #15
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Is the if-statement particularly slow ?

    Originally posted by dingo_aus:
    BTW the dynamic branching doesn't seem to work with my NV5900 (forceware 62.71).

    Is there something I should do to help it run properly?
    It seems this is actually the 5x00 hardware not being capable of doing early stencil rejection.

  6. #16
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Is the if-statement particularly slow ?

    Originally posted by Corrail:
    The GeForce FX series isn't able to do dynamic branching in pixel shaders. You won't get it work on your card. But you can either buy a new graphic card or use a software rasterizer (NVemmulate).
    Well, the point of that demo is to show that you can implement dynamic branching for some common situations without special hardware support, and still get as good or actually better performance than real dynamic branching.

  7. #17
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Is the if-statement particularly slow ?

    Originally posted by wizzo:
    Hi again,

    Now that i had some time to look at it, i'd like to get some precision. I'm quiet a beginner so dont hesitate to explain to me like you would to a kid =)

    So here are the steps :

    1 - We render our first pass with depthAmbiant shader ON, rendering for shadowed aeras

    2 - XXXX

    3 - Finally we do our second pass with lighting shader ON only where stencil value says, so that lit fragments are actually lit.

    That's the second step i'm missing :

    the if shader return as a color param the distance from the light to the fragment.
    And i know thats when the stencil buffer decide whether a fragment is lit or not, but i dont get how.

    thx to anyone
    wizzo
    The result from the if-shader is in the alpha. By using the alpha test you kill fragments that are unlit. So the stencil is only updated for lit fragments.

  8. #18
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Australia
    Posts
    20

    Re: Is the if-statement particularly slow ?

    It seems this is actually the 5x00 hardware not being capable of doing early stencil rejection.
    Does these mean the ATI cards can do early stencil rejection?

  9. #19
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,444

    Re: Is the if-statement particularly slow ?

    Yes, and the 6800 too (though it seems a bit more sensitive).

  10. #20
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Australia
    Posts
    20

    Re: Is the if-statement particularly slow ?

    Ah good to know - pity a 6800 at the moment would cost more than the rest of my PC combined

    (and depreciate a lot faster too)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •