vertex programs

Started by
5 comments, last by cody 22 years, 3 months ago
how do i use nvidia vertex programs in opengl? my problem is that i dont know how to compile or load them. in d3d i had a compiler named nvasm. but how do i do this in opengl? i didnt find such a program in the sdk! cody
Advertisement
you don''t need to compile them, you simply load them directly into OpenGL using glLoadProgramNV.

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---I write code.DelphiGL (http://delphigl.cfxweb.net)
ah thanks, you are right...
i have got it working now but i have some problems with the transformations:

i want to render some vertices of a model, so the coordinates are given in model-space.
the nvidia docs say the vertex program must transform them to "homogenous clip space". but wat means that and which transformations i have to apply?

i tried this:
when the models transformation matrix is set i use
glTrackMatrixNV( GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV );

then the vertex program does this:
DP4 o[HPOS].x, c[0], v[OPOS];
DP4 o[HPOS].y, c[1], v[OPOS];
DP4 o[HPOS].z, c[2], v[OPOS];
DP4 o[HPOS].w, c[3], v[OPOS];

but somehow the position that comes out is wrong, i tested other combinations for GL_MODELVIEW_PROJECTION_NV/GL_IDENTITY_NV but nothing works.

any suggestions?
i didnt solve the problem yet :-(

so i push the thread up...
or doesnt anybody use vertex programs?
The code you gave should work perfectly, what is going wrong?

Check out some of the examples in the OpenGL SDK available on NVIDIA''s developer website (http://developer.nvidia.com), in particular the vtxprg_litquad demo which illustrates how to use vertex programs to light a single quad.

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---I write code.DelphiGL (http://delphigl.cfxweb.net)
thx, i looked at the sample.

it seams that my model transform is totaly ignored, because
glVertex(0,0,0) draws a point at 0,0,0 no matter where my object actually is... it draws in world space.
is there something special with glTrackMatrix??

im quite confused.

This topic is closed to new replies.

Advertisement