Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

Hybrid View

  1. #1
    Intern Contributor
    Join Date
    Oct 2002
    Posts
    56

    NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    This is my first post on the board.

    Anyways, I have the Det 40's installed and all that good stuff, but let's say I'm using NeHe's lesson2 code and I want to make my own ARB_vertex_program. What code would I need to add? I searched the board and couldn't find what I was looking for, and I also can't seem to find any examples anywhere on the 'net.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    You need to use glGetString() to get the extensions string to test that the extension is supported.

    Then you need to use wglGetProcAddress() (or glx, or whatever your platform is) to get the extension functions as defined in the extension registry.

    You need to Enable() on VERTEX_PROGRAM_ARB.

    You need to use GenProgramsARB() to generate program Ids (much like texture Ids), BindProgramARB() to bind a program, ProgramStringARB() to actually send your program to the system (much like TexImage). You do this on the VERTEX_PROGRAM_ARB target.

    Use GetString() on PROGRAM_ERROR_STRING_ARB to get the error message if ProgramStringARB() failed.

    You need to set up any parameters your program may need with ProgramEnvParameterARB() and ProgramLocalParameterARB().

    You need to feed vertex data to the program with VertexAttrib*ARB() (or the array version).

    For more details, see the document at http://www.nvidia.com/dev_content/nv...ex_program.txt (or in the extension registry, or on ATIs web site; same thing)
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

  3. #3
    Intern Contributor
    Join Date
    Jan 2001
    Posts
    87

    Re: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    Is there any difference between GL_NV_vertex_program and GL_ARB_vertex_program or they have only different names?

    And what about GL_EXT_vertex_program (or sth like that)?

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

    Re: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    There are quite a lot of differences and they are definitly not compatible. Check out the specs in the extension registry: http://oss.sgi.com/projects/ogl-sample/registry/
    XEngine - The Platform- and API-Independent 3D Engine
    with Programmable Pipeline Support: [URL=http://xengine.sourceforge.net
    My]http://xengine.sourceforge.net

  5. #5
    Intern Contributor
    Join Date
    Oct 2002
    Posts
    56

    Re: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    Originally posted by jwatte:
    You need to use glGetString() to get the extensions string to test that the extension is supported.

    Then you need to use wglGetProcAddress() (or glx, or whatever your platform is) to get the extension functions as defined in the extension registry.

    You need to Enable() on VERTEX_PROGRAM_ARB.

    You need to use GenProgramsARB() to generate program Ids (much like texture Ids), BindProgramARB() to bind a program, ProgramStringARB() to actually send your program to the system (much like TexImage). You do this on the VERTEX_PROGRAM_ARB target.

    Use GetString() on PROGRAM_ERROR_STRING_ARB to get the error message if ProgramStringARB() failed.

    You need to set up any parameters your program may need with ProgramEnvParameterARB() and ProgramLocalParameterARB().

    You need to feed vertex data to the program with VertexAttrib*ARB() (or the array version).

    For more details, see the document at http://www.nvidia.com/dev_content/nv...ex_program.txt (or in the extension registry, or on ATIs web site; same thing)
    Cool, thanks. That link is some pretty heavy reading, but I should get through it soon.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Dec 2000
    Location
    Madrid, Spain
    Posts
    149

    Re: NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

    Originally posted by MichaelK:
    Is there any difference between GL_NV_vertex_program and GL_ARB_vertex_program or they have only different names?

    And what about GL_EXT_vertex_program (or sth like that)?
    You can see the differences in detail with those two extensions in the ARB_vertex_program spec.


    [This message has been edited by Cab (edited 10-22-2002).]

Posting Permissions

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