Vertex program

Gang,

Does anybody know a good tutorial or a good book about ‘vertex programs’ in OpenGL? I searched google and I didn’t find very much stuff about this subject.

I would appreciate it, if anyone could give me good pointers or book titles about this subject.

Thanks a lot.

It’s an NVidia specific extension.
Go to this site, and use their internal search engine to find information:- http://developer.nvidia.com/

Does it make sense to use vertex programs? ok, I am depending on a NVIDIA card. But do I get a big performance gain, when I do for instance my lighting with a vertex program instead doing it with the normal OpenGL commands?

In vertex programms you can do much more than lighting only.ie.: you can use them to deform your mesh.

Yes I know. But for example, is the lighting with vertex programs faster than the lighting with the normal opengl commands?

Speaking of mesh deformation, is it possible to perform displacement mapping with vertex program? I mean I’m not 100% sure that a texture one might like to use to displace a mesh will be available for reading by a vertex program. At present my displacement mapping is done as a `preprocess’ stage on the CPU and is too slow to be real-time.

In general I am under the impression that the Programs are slower than the Fixed Function/T&L Path. In the case of implemented a Program to do exactly the equivalent of the fixed function path. Of course as stated there is no reason to do this other than if you need a small amount of fixed T&L mixed with other complex Programs.

Devulon

normally you don’t need to simulate the fixed function pipeline in a vertexprogram, but only the parts you need from it. that means for example, if you are at the outside and you have the blue sky wich shines from above, simply take the z of the normal and you got the shading (you can even add some constant to it for more diffusion/ambientation of the term ). then vp’s get much faster.

“Speaking of mesh deformation, is it possible to perform displacement mapping with vertex program? I mean I’m not 100% sure that a texture one might like to use to displace a mesh will be available for reading by a vertex program.”

I am 100% sure: it’s NOT possible.
You can’t read the texturedata in a Vertex programm.

Thanks for your replies.

But actually, I need only to light my textured terrain. And I am wondering which technique I should use:

  • OpenGL light?
  • a vertex program which handles the light stuff?
  • perpixel lighting?
  • or calculate my own lightmaps/shadows and combine them with the textures?

Originally posted by AdrianD:
I am 100% sure: it’s NOT possible.
You can’t read the texturedata in a Vertex programm.

well… this will change… vp2.0 will have this possibility, if it will ever exist (possibly gl2.0 will be faster )

remember the displacementmapping of the new matrox, it actually only is part1:realtimetesselation_of_geometry and part2:texturelookup in a vertexprogram…

now with wich extension we’ll use this feature, we don’t know yet, but at least in gl2.0 it will be in and i guess nvidia will have it on the nv30 in a vp2.0 program language…

A027298,

there are very easy and well-done tutorials about vertex programs on this website : http://www.chronos-central.com/index.shtml

Hope this help.

Pacôme