View Full Version : GL_ARB[NV]_vertex_program

03-09-2004, 11:10 AM
I'm having some problems understanding the two extensions GL_ARB_vertex_program and GL_NV_vertex_program. I understand how to set up the extensions and load programs, but I'm confused as to the format of the programs (most tutorials seem to leave that part out.) I'm guessing they have to be assembled before they're loaded, but according to nVidia's site, there's a difference between the DirectX 8+ vertex shaders and OpenGL vertex programs and...well, I'm starting to confuse myself. Can someone explain this to me, or point me to a document which explains it in pretty good detail? Thanks!

03-09-2004, 06:00 PM
The format? Look at the many examples you can find on the net.

There is always a header :

!!ARBvp1.0 or !!VP1.0

declare options in ARB. example :
option ARB_percision_fastest;

Then make a few declarations of constants, attributes, output, temporaries.
NV only requires constants because the others are predefined. In ARB, you can give them the name you desire.

Then comes the program body :

instruction destination, source1, source2, source3, ... ;

and to finish ...


of course, all that should be in a single string that you upload to GL (glProgramStringARB or glLoadProgramNV)

The documents that explain these in detail are the specifications.

There are books like "OpenGL Extensions Guide" http://search.barnesandnoble.com/textboo...isbn=1584502940 (http://search.barnesandnoble.com/textbooks/booksearch/isbninquiry.asp?userid=35BY6L0H3L&sourceid=00387615289333565456&bfdate=03%2D09%2D2004+22%3A00%3A03&isbn=1584502940)

03-09-2004, 08:26 PM
From what I'm gathering from your post, you don't have to compile the program then? Just send it as a string? And yes, I've seen programs with that format, but I was trying to refer to the format the compiled byte code. Sorry for the confusing...very difficult topic for me to grasp. ^^

03-10-2004, 09:21 AM
I guess you are from a d3d background.

No, you don't get to access bytecode. When you send the string (ASCII 8 bit), it is immediatly compiled to bytecode.

There has been discussions about this feature beeing available. Some people want real time ultra fast compiling. If you need it, you can post a message in the suggestions forum.