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 1 of 4 123 ... LastLast
Results 1 to 10 of 37

Thread: difference between register combiners and fragment programs

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2003
    Posts
    10

    difference between register combiners and fragment programs

    Hi i'm just wondering the differences between fragment programs and register combiners. are combiners used only when combining multiple textures in the same pass? It seems to me that fragment program can do everything register combiners can do. Am i correct in this? If so does fragment programs replace the need to use register combiners. thanks

  2. #2
    Intern Contributor
    Join Date
    Nov 2002
    Location
    Austin, Texas
    Posts
    50

    Re: difference between register combiners and fragment programs

    Fragment programs are more powerful than register combiners, but fragment programs (whether using the multi-vendor ARB_fragment_program extension or the more powerful NV_fragment_program extension) require more recent GeForceFX GPUs for hardware acceleration (though users of earlier GeForce GPUs can enable the extensions via SW emulation for development purposes - SW emulation is too slow for production use however).

    If you want to target the widest range of NVIDIA GPUs, use NV_register_combiners. If you want all the latest functionality, use ARB_fragment_program, or better yet, NV_fragment_program.

    If you program with Cg (C for Graphics), you can write your programs in Cg and then simply indicate with your target profile whether to target register combiners or fragment programs. The "fp20" profiles targets register combiners and texture shaders; the "arbfp1" profile targets ARB_fragment_program; and the "fp30" profile targets NV_fragment_program.

    One problem is how to deal with this variety of profiles supported by various GPU generations. One solution is writing your Cg shader programs such that a single program can be recompiled, via conditional compilation, to target a basic profile such as fp20 for basic rendering but use the fp30 or arbfp1 profiles if more capable hardware is detected. This can allow you to adapt the shader quality to the available hardware.

    The CgFX file format is really useful for this purpose. You can write a shader with CgFX and write multiple "techniques" in Cg embedded within the CgFX file for various GPU capabilities.

    I hope this helps.

    - Mark

  3. #3
    Junior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    FRANCE
    Posts
    147

    Re: difference between register combiners and fragment programs

    Mark, the Cg solution doesn't work with the ati 8500 at this time (and don't tell me that one can use the arb_texture_env_combine). BTW is the final combiner the only difference between DX8.1 pixel shader and register combiner? I mean, nvparse can parse either code for a GF3, so is there any difference in term of capacities?

    Arath

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    555

    Re: difference between register combiners and fragment programs

    Register combiners are a bit more powerfull than DX8 pixelshaders as they directly expose the GeForce3+ hardware.

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    765

    Re: difference between register combiners and fragment programs

    Jason, correct me if I'm wrong but the NV_register_combiners doesn't expose the dot3_rgba functionality which is available in DX8.1 ps

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    Jan 2001
    Location
    NVIDIA, Austin, TX
    Posts
    555

    Re: difference between register combiners and fragment programs

    dp4 in ps1.2+ is essentially the same as this:

    dp3 r0.rgb, t0, t1
    mad r0.a, t0.a, t1.a, r0.b

    its just internally changed into multiple instructions (counts as 2 instructions).

  7. #7
    Junior Member Regular Contributor
    Join Date
    Nov 2002
    Location
    Los Angeles, CA
    Posts
    206

    Re: difference between register combiners and fragment programs

    You can do a 3 component dot product whose results get stored in all components of rgba with register combiners. If you use two combiners, you can also do a full 4-component dot product.

  8. #8
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    765

    Re: difference between register combiners and fragment programs

    Originally posted by Coriolis:
    You can do a 3 component dot product whose results get stored in all components of rgba with register combiners.
    With two combiners I clearly see how, but I'd be glad to know how with one combiner.


    Jason, if the dot4 instruction can be emulated using 2 combiners, imagine a pixel shader that calls 8 consecutive dot4 instructions : that means GF3-4 need 16 combiner stages to emulate such shader ?

    [This message has been edited by vincoof (edited 03-28-2003).]

  9. #9
    Member Regular Contributor
    Join Date
    Jul 2002
    Location
    Austria
    Posts
    280

    Re: difference between register combiners and fragment programs

    You can't have 8 dp4s in a D3D 8.1 pixel shader version 1.2 or 1.3.
    Quote from the Direct3D documentation:
    For pixel shader version 1.2 and 1.3, dp4 counts as two arithmetic instructions.
    Regards.
    XEngine - The Platform- and API-Independent 3D Engine
    with Programmable Pipeline Support: [URL=http://xengine.sourceforge.net
    My]http://xengine.sourceforge.net

  10. #10
    Member Regular Contributor
    Join Date
    Jul 2002
    Location
    Austria
    Posts
    280

    Re: difference between register combiners and fragment programs

    On the topic of reg combiners/D3D pixel shaders: Does anybody know how to properly implement the D3D pixel shader 'cmp' instruction with register combiners?
    XEngine - The Platform- and API-Independent 3D Engine
    with Programmable Pipeline Support: [URL=http://xengine.sourceforge.net
    My]http://xengine.sourceforge.net

Posting Permissions

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