vertex programs
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
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)
Jason A.
---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
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 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?
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)
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)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement