PDA

View Full Version : problem putting vertex program working



jcabeleira
08-13-2003, 01:41 AM
vertex programs are new for me so i'm trying to put them running but there's a problem because every time i try to load the program an GL_INVALID_OPERATION error is generated and i don't now why.

here is a sample of the code:

unsigned char programa[]= "!!VP1.0\nEND";
glGenProgramsNV(1, &id_programa);
glBindProgramNV(GL_VERTEX_PROGRAM_NV, id_programa);
glLoadProgramNV(GL_VERTEX_PROGRAM_NV, id_programa, strlen((char *)programa)+1, programa);

if(glGetError()== GL_INVALID_OPERATION)
MessageBox(NULL,NULL,NULL,NULL)

i guess the error is generated because the program doesn't to a thing and opengl spec define that program loading will fail if none of the HPOS register is written, if that's the case could any one just tell me what can i do to just get it working?

[This message has been edited by jcabeleira (edited 08-13-2003).]

Tom Nuydens
08-13-2003, 02:17 AM
The fastest way to get results on the screen would be to add "OPTION NV_position_invariant;" to your program. Alternatively, you have to actually do something in your program. I strongly recommend that you try this some time http://www.opengl.org/discussion_boards/ubb/smile.gif

There are plenty of demos on the web that use vertex programs, so if you're not sure what to do, download a couple of these demos and read their vertex programs. There are also some smaller code examples in the extension spec. By the way, you'd be better off using ARB_vertex_program instead of NV_vertex_program. It's easier to use and supported on a wider range of hardware.

-- Tom

jcabeleira
08-13-2003, 02:53 AM
By the way, you'd be better off using ARB_vertex_program instead of NV_vertex_program. It's easier to use and supported on a wider range of hardware.

-- Tom
i know, but unfortunetly my graphic board doesn't support it.

thank's for the advices.

Tom Nuydens
08-13-2003, 03:29 AM
What card would that be, then? All cards that support NV_vertex_program should also support ARB_vertex_program. Try upgrading your drivers?

-- Tom

jcabeleira
08-13-2003, 06:05 AM
i've got an Gainward geforce4 ti4200, can it run GL_ARB_vertex_program if i install new drivers?

elias
08-13-2003, 06:18 AM
Yes, even my lowly gf2mx can do ARB_vertex_program with newer drivers, although anything less than a gf3 will run the programs in software

- elias