Vertex shader

from Wikipedia, the free encyclopedia

Vertex shader (also: vertex shaders ., Abbr VS ) are a type of shaders . They are executed in the course of the graphics pipeline , i.e. the processing of a 3D object on the graphics card . In this context, vertex shaders are responsible for processing all corner points of the 3D model (the so-called vertices ). This is why the vertex shader is normally called once for each vertex, which is where the name comes from.

function

A vertex shader is used to manipulate the geometry of a scene. For this purpose, the coordinates of the vertices (corner points of three-dimensional objects) of the surfaces are transformed (which can include both a shift, a rotation or a scaling, possibly also combinations). This allows the shape of objects to be influenced, which in turn is reflected in their lighting. A typical modification of the model carried out in the vertex shader concerns the coordinate systems . The vertex shader first converts the position of the vertices from the coordinate system of the 3D model into the global coordinate system shared by all 3D objects. Then he can also convert the vertices into the camera coordinate system. However, since the vertex shader is called per vertex, the vertex shader cannot add new points to the 3D model. This task, however, is performed by the geometry shader , which is usually called after the vertex shader. Modern graphics cards can also have tessellation shaders for adding new vertices. In terms of functionality, the vertex shader replaces the older and less flexible Transform & Lighting (T&L).

With the help of vertex shaders, effects such as vertex lighting, terrain / object deformation, water waves or fisheye lenses are possible. Most graphics chips today contain shader units that execute the vertex shaders. This means that these geometry calculations do not have to run on the system's CPU , which relieves the load and can be used for other tasks. As a rule, several shader units are built into GPUs so that they do not become a bottleneck in the graphics pipeline.

Additional information on the processing chain and the programming of shaders can be found in the article Shader .

compatibility

hardware

The following table gives an overview of which graphics cards or graphics chips with which DirectX version support which vertex shader version. For the sake of completeness, T&L, the forerunner of vertex shaders, has also been included. It should be noted that graphics chips usually also support older versions, for example vertex shader 3.0 chips can also work with vertex shaders version 2.0. This backward compatibility is mainly handled by the graphics card driver and not the graphics processor.

VS version required DirectX version 3DLabs ATI Intel Matrox NVIDIA S3 Graphics SiS XGI
T&L 7.0 - Radeon 7000 series - - GeForce 256 , GeForce 2 series , GeForce 4 MX - - -
1.0 / 1.1 8.1 Wildcat VP Radeon 8500-9250 - Parhelia series GeForce 3 series , GeForce 4 series - Xabre series Volari V3 series (except V3XT)
2.0 9.0 Wildcat Realizm Radeon 9500 - 9800 , X300 - X850 Intel GMA 900 - GeForce FX series DeltaChrome , GammaChrome , Chrome-S2x series Mirage 3, Mirage 3+ Volari V3XT, Volari V5 series, Volari V8 series, Volari 8300, Volari XP10
3.0 9.0c - Radeon X1 series Intel GMA 950, 3000, X3000 - GeForce 6 series , GeForce 7 series - - -
4.0 10 - Radeon HD 2000 series - - Geforce-8-series , Geforce-9-series , Geforce-200-series - Mirage 4 -
4.1 10.1 - Radeon HD 3000 series - - Geforce 200 series Chrome 400/500 series - -
5.0 11.0 - Radeon HD 5000 series - - Geforce 400 series - - -

software

Because the range of functions and the programmability can vary greatly depending on the shader version, a developer is basically faced with the choice:

  • To do without vertex shaders entirely and to calculate everything with the help of the CPU. This approach is no longer common today because almost every 3D application today has performance requirements that require sufficiently fast graphics cards, which in turn are so up-to-date that they already contain vertex shader units.
  • to support many vertex shader versions by writing its own optimized shader for each version to be supported (so-called render paths ). All graphics cards that are compatible with the targeted shader versions are supported.
  • only support vertex shader versions from a certain version onwards.

As of DirectX Version 10, the so-called Fixed Function Pipeline, a predefined vertex and pixel shader combination for simple tasks, is no longer supported. The programmer always has to specify a vertex shader.

See also

Web links