View Full Version : what is vertex shader and fragment shader?

07-12-2003, 07:11 AM
I'm new to GPU programming,and I know it contain vertex shader and fragment shader(pixel shader),but what is vertex shader?what is fragment shader?I want to get a specific definition of them,and which of them can modify the texture map.If there are some documents introduce them,please tell me too.Thanks!

07-12-2003, 07:18 AM
Read the different specs on vertex and fragment programs here. http://oss.sgi.com/projects/ogl-sample/registry/

Goto the developer pages of NVIDIA or ATI for examples.

07-12-2003, 07:35 AM
Relic just covered the 'how'.
If you're interested in the 'what':
Shaders (logically) replace configurable parts of the pipeline with programmable units. Instead of flipping switches on and off (lights in the vertex stage, textures in the fragment stage), you can go freestyle in a programming language of sorts.

07-12-2003, 08:58 AM
Actually, the specification for ARB_fragment_program and ARB_vertex_program are pretty good at describing the "what" as well, because they're written like a spec -- they specify exactly what happens and what parts they replace from the OpenGL pipeline.

If you don't know the traditional OpenGL pipeline well already, you're bound to get confused, though; make sure you understand the basics first! (rougly: vertex specification, transform, color determination, fragment issue, fragment processing including texture fetch and texture environmeng application, alpha/depth/stencil tests, color sum, fog, and framebuffer blending).

07-12-2003, 09:58 AM
This will explain each and show how they relate to the rest of the OpenGL pipeline: