Guajara in other languages: Spanish, Deutsch, French, Italian ...



Vertex and pixel shaders

Vertex and pixel shaders are computer programs that run on a graphics card, executed once for every vertex or pixel in a specified 3D mesh. They operate in the context of interactively rendering a 3D scene, usually using either the Direct3D or OpenGL API.

Table of contents
1 Background
2 Details
3 Capabilities
4 See Also
5 External links

Background

Flexible shaders initially were used for non-interactive rendering applications like Pixar's RenderMan, famously used to render the feature film Toy Story.

3D hardware previously used fixed-function pipelines in which, for example, one was stuck with the lighting model chosen by the hardware vendor. Graphics hardware was able to do transformation and lighting (T&L for short) on the card, but it was not flexible. A vertex shader sidesteps the T&L stage in the pipeline and lets the user add on to it.

Pixel shaders operate after the geometry pipeline and before final rasterization. They operate in parallel with multitexturing to produce a final pixel color and z-value for the final, rasterization step in the graphics pipeline (where alpha blending and depth testing occur).

In the past few years, video cards from Nvidia and ATI have started supporting pixel and vertex shaders in hardware, allowing their use for real-time rendering. The technology is by now quite mature, and the latest generation of games, including Doom3 and Half-Life 2 make extensive use of hardware shaders. A brewing standards battle between ATI and Nvidia should prove entertaining viewing.

Details

The programs are written in either the native assembly language of the card or in a high-level shader language like the aptly named High Level Shader Language. Some key facts about vertex and pixel shaders are that they

Capabilities

The capabilities of vertex and pixel shaders are still being explored, and since hardware capabilites are improving with each generation we can expect their abilities to approach those of programmable shaders such as RenderMan's.

There exist vertex shaders that

  • apply an arbitrary deformation to the vertices of a mesh
  • perform toon rendering
  • fake motion blur
  • apply a fisheye lens effect to the scene

There exist pixel shaders that

One of the most intriguing uses of hardware shaders is for physical simulation. The powerful vector math and parallelized architecture make current graphics cards much faster than general-purpose CPU's for certain simulations where the current state at a certain point is only dependent upon the previous state for a small area around it, like turbulent flow. Several projects are exploiting this unintended use.

See Also

External links





Wikipedia - All text is available under the terms of the GNU Free Documentation License.

Tagoror dot com  -  Legal Information  -  Contact us