Archived

This topic is now archived and is closed to further replies.

AyaKoshigaya

VertexShader / VertexPrograms... what are they used for?

Recommended Posts

Hi, I''ve a question about VertexShader/VertexPrograms... I understand how they work, but... what can I do with a VertexShader?? I mean.. sure, I can do anything with them.. but, why??? I have no idea why, and for what I should use a VertexShader... Has anyone a good Demo VertexShader-Script??? Au''revoir, Aya~

Share this post


Link to post
Share on other sites
if you don'' know, you betta axe somebody....

To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Share this post


Link to post
Share on other sites
If your card supports the ARB_vertex_program extension in hardware (that is, GeForce3 or higher, Radeon8500 or higher) you should download the little cel-shading application that I''ve submitted to NeHe Productions at the downloads page (under the letter ''C'').
You can enable and disable vertex programs and see the performance gain. It will be even more obvious if you have a slow processor (pentium 3 or slower).

Also, you can take a look at the ARB vertex program + fragment program + vertex buffer object demo that I''ve submitted too (under the letter ''A'') which shows some other performance difference, but especially shows that you need to use vertex programs to benefit vertex buffer objects.

In general, when you have to compute information per vertex very often (typically, view-dependant or light-dependant algorithms when the camera or the lights move, respectively), you can''t use display lists or vertex buffer objects if that vertex information is computed in software. When computed into a vertex program, it makes display list and vertex buffer objects very easy to integrate.

Share this post


Link to post
Share on other sites
They are useful tool for processing vertices and fragments/pixel. You can implement phong shading, bump mapping, enviromental bump mapping and such technologies using vertex and pixel shader.

Normally vertex and/or pixel shader are slower than the fixed OpenGL pipeline but e.g. if you want to implement bump mapping (with specular shading) you need to render about 11 passes (and this isn''t the complete euqation for lighting, attenuation not inculded) with 2 texture units and a shininess of 32. With vertex and pixel shader you can do that in only on pass.

BTW, Vertex Programs are supported at a GeForce 256 and up! :-)

Corrail
corrail@gmx.at
ICQ#59184081

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Just take a look at my tut about GL_ARB_VERTEX_PROGRAM : http://www.phobeus.de/hosting/dgl/main.php?id=2&page=tutorial&tut=vertexprogram&head=vertexprogram
I''ve mentioned some applications of VPs at the end of it ;-)

Share this post


Link to post
Share on other sites
it would be easily understandable...if i were from germany...



There aren''''t problems that can''''t be solved with a gun...

Share this post


Link to post
Share on other sites
quote:
Original post by Corrail
Normally vertex and/or pixel shader are slower than the fixed OpenGL pipeline



BTW, Vertex Programs are supported at a GeForce 256 and up!


They can be faster or slower, depending on the setup. Most (all?) hardware that supports vertex programs does not have a fixed function pipeline, rather it emulates it through vertex programs.

Also, the GF 256 itself doesnt support vertex programs, they are emulated by its drivers in software only.

-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack

Share this post


Link to post
Share on other sites
quote:
Original post by Corrail
BTW, Vertex Programs are supported at a GeForce 256 and up! :-)


in hardware? only on gf3 and up, or radeon8500 and up..

and, on radeon9500 and up, the fixed function is just another vertexshader, too..

dunno about gfFX.. but i guess it still has a fixed function.. as it has everything else of the gf3 and gf4 internally, too..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
quote:
Original post by davepermen
quote:
Original post by Corrail
BTW, Vertex Programs are supported at a GeForce 256 and up! :-)

in hardware? only on gf3 and up, or radeon8500 and up..



Oh, ok. My fault!
Thought they''re in hardware too!

Corrail
corrail@gmx.at
ICQ#59184081

Share this post


Link to post
Share on other sites