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 2 12 LastLast
Results 1 to 10 of 12

Thread: shaders

  1. #1
    Junior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    New Zealand
    Posts
    147

    shaders

    You've all prob seen this question a million times over, so sorry if you have!

    How does one go about using pixel shaders and vertex shaders in OGL, i know the basics about using then in DX, but was wondering how to do this using OGL, because i really want to learn more about them but not have to goto DX!
    I have no signature, so ill just write random nonsense here......

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    Re: shaders

    1st get the terminology right.

    Vertex Programs. In OpenGL we like to use correct meanings to things, other than made up buzzwords in other API's. Programmable vertex piplines do not shade vertices. Infact a perfectly valid vertex program, doesn't even have to process color, lights or texture coords at all. You wouldn't see anything tho.

    Register Combiners and texture shaders are what OpenGL people call "pixel shaders". In actual fact they should be called fragment shaders.

    [PLUG]
    Have a look at www.nutty.org for some nice simple vertex program, and register combiner demos.
    [/PLUG]

    Also visit nvidia's developer site, for a huge amount of white papers n demos n stuff.

    Mr "DX hater and pedantic git" Nutty

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

    Re: shaders

    Hey, let's not leave ATI's terminology out of this. The EXT extension that ATI helped define is called EXT_vertex_shader (I do prefer vertex program, but EXT_vertex_shader is a much better interface).

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Aug 2000
    Location
    Portsmouth, Hampshire, England
    Posts
    1,063

    Re: shaders

    Well part of that "better" must be due to personal preference, no?

    Same as people think nvasm string style RC's are better.. I think they're horribly miss-leading, and harder to understand that the Procedural method of accessing RC's.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Nov 2000
    Location
    New Zealand
    Posts
    147

    Re: shaders

    Thanks for you replies

    Sorry about the wrong terminology, like i said before, i am just starting out on shaders
    I have no signature, so ill just write random nonsense here......

  6. #6
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    Beloit, Wisconsin
    Posts
    562

    Re: shaders

    Originally posted by Nutty:
    Well part of that "better" must be due to personal preference, no?

    Same as people think nvasm string style RC's are better.. I think they're horribly miss-leading, and harder to understand that the Procedural method of accessing RC's.

    I personally think RC's are a pain in the arse all together

  7. #7
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Re: shaders

    Originally posted by NitroGL:
    I personally think RC's are a pain in the arse all together
    Agreed. If the register combiners could be replaced with something that has the same language syntax, flexibility, and precision as vertex programs, I'd be one happy boy.

    -- Zeno

  8. #8
    Intern Newbie
    Join Date
    Jun 2000
    Posts
    40

    Re: shaders

    I second Zeno's idea.

    However, I think that it is probably a very complicated task...
    Just give me SMP.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: shaders

    hm.. ati has yet the asm-styled pixelshader. and .. dx has the asm-styled pixelshader. just the architecture of the nvidia-boards are stupid with its register combiners.. A*B*C needs 2 general combiners, AdotB + CdotD = Ax*Bx + Ay*By + Az*Bz + Cx*Dx + Cy*Dy + Cz*Dz needs only one

    rc's are very powerfull (scripted or with functioncalls setup). but very complicated.. most of the WOW-demos on gf3 can be done on gf2 yet.. (or gf1). perpixellighting is not much difference on gf1 and 2.. possibly in 1 pass even, too! thats kind of funny
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  10. #10
    Member Regular Contributor
    Join Date
    May 2000
    Posts
    454

    Re: shaders

    Originally posted by davepermen:
    just the architecture of the nvidia-boards are stupid with its register combiners.. A*B*C needs 2 general combiners, AdotB + CdotD = Ax*Bx + Ay*By + Az*Bz + Cx*Dx + Cy*Dy + Cz*Dz needs only one
    IIRC, AdotB + CdotD needs 2 combiners (since you cant use the dot product and the sum at the same time)

    Seems dumb? maybe yes. But when you get into the details, there is a good reason why you cant do A*B*C in one register. Its a 2 step process: multiply A*B, take the result and multiply result*C.

    Without going completely overboard on the hardware (which would affect price and performance), they had to make some reasonable decisions on what to do. They decided that if you want 2 multiplies, you would have to resort to using 2 combiners. Now, they could have thrown a second successive multiply into the first combiner, but when you design hardware like this, you have to time you hardware to the longest path. If they had 2 successive multiplies, then processing would be slower for calculations that only use 1 multiple. And if you say "well they could have made it only wait for the second multiply if it is used", well then thats what the second combiner is for..only wait for the second combiner to finish if it is enabled.
    Ron Frazier

Posting Permissions

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