GL_*_program_ARB lexical question

as u may have noticed, i am strugglig to learn ARB programming, but with little effort, right now:
I am stuck with the very base things for now. I wrote a lil application that should draw an untextured, unlit quad in the mid of the screen. Just some stupid color gradient. Instead of it, just black.
I am starting to feel like the problem is that i am not sure of what i am writing. So i'd like someone answer some little questions:
1)what is an ATTRIB? what is a PARAM? what is the difference?
2)how i pass a vertex from opengl to my vertex program? just a glVertex3f() without glbegin and glend? or i have to use Arrays? all the examples i looked at were using arrays...
3)how i pass my processed vertices from vertex program to fragment program? i will have far more fragments than vertices, isn't it?
4)where do i put outputs? some files have a simil define on top like:

OUTPUT outPosition = result.position

other programs just have the restul stuff at the end. is there any standard format file??

if u got bored reading this message, just point me to a good book and make me shut up until i finished studing it
thx, byeeee!!!

Re: GL_*_program_ARB lexical question

Hello!

1)
An ATTRIB is 4 component vector which is passed to the GL with every vertex. e.g. a normal or a texture coordinate is an ATTRIB.
A PARAM is a 4 component vector which is passed to the GL wich every rendering (glBegin, glDrawArrays, glDrawElement, ...) e.g. the light position or light color is a PARAM

So ATTRIB do normally change with every vertex you pass to the GL and PARAM normaly change with every rendering command.

2)
There's no difference passing vertex to the GL if you use vertex program or if you don't. You can use glVertex* oder Vertex arrays. Should both work!

3)
You have to use Texture Coordinates. In modernt graphic cards you have about 8 texture coordinates available so you can use them to pass data from vertex programs to fragment programs.

4)
ARB_VERTEX_PROGRAM and ARB_FRAGMENT_PROGRAM have a couple of ways to access outputs (and attribs, params, ...):

Directly by using to name in code:

MOV result.position, myvec;

Or by defining it before:

OUTPUT outPosition = result.position;
MOV outPosition, myvec;

I hope this might help u! :-)
But why don't you learn GLslang instead of ARB_*_programs?

There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

There is another theory which states that this has already happened...

Re: GL_*_program_ARB lexical question

hi corrail,
thanks fow the help.
I have just some trouble understanding how i use texture coords to pass data from vertex to fragment program. What if i have no texture at all? Puzzling.
Anyway, as for now i am just a wet nose, fresh fresh from graduation, my thesis was on opengl, but on a moooore easy way. Now my boss wants to use latest tech (and i can understand that), and ordered me to learn... the problem is that i am advancig just on my own, so i just follow the trails that i find here and now..
by the way, what is GLslang??? never heard about it.
By the way off topic... what do u do 4 living? I am working as IT engeneering but... bah Games is what i'd like to do
See ya man, gotta go...
bye the gunslinger

There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

There is another theory which states that this has already happened...