Vertex shader (1)

Source: Internet
Author: User

Vertex Shader Architecture:

All data in vertex shader is represented by the quad-floats of 128-bit (4x32-bit).

Vertex shader executes the program linearly--an instruction (introduction) executed in a single instruction. It does not allow loops, jumps, or conditional branching. In DirectX 8.x, the maximum length of a vertex shader program is limited to 128 instructions. It is impossible to calculate the illumination (lighting) with vertex shaders, which is used to calculate the transformation (transformation). In a time period, only one vertex shader is allowed to be active (active). Each active vertex shader must calculate the output data for each vertex that is required.

A vertex shader uses 16 (V0-V15) input registers (input register) to access (access) vertex input data. Vertex input registers can easily store data for a typical vertex: the coordinate position of vertices, normals, diffuse emission and highlight colors, fog coordinates, size information for points, and so on.

The constant register (constant registers) is loaded by the CPU before vertex shader starts processing the parameters defined by the programmer. Vertex shader cannot write to a constant register. Constant registers are used to store parameters such as source position, matrix, animation effects program data, vertex interpolation data, keyframe interpolation, and so on. These constants can be applied in the program and can even be addressed indirectly with the help of the address register (address register) a0.x. However, only one constant can be used per instruction. If an instruction requires more than one constant, it must be loaded into a temporary register (temporary registers) before it is requested. The names of the constant registers is c0-c95 or, in the case of the ATI RADEON 8500, c0-c191. The Temporary register (temporary registers) consists of 12 registers, which are used to perform an intermediate operation (intermediate calculations). They can be used to load and store data (Read/write). The names of the temporary registers is r0-r11.


There are 13 output registers (vertex outputs), which depend on the underlying hardware. The names of these registers begin with "O". Vertex output is available for each raster, and your vertex shader program accesses it through write-only (write-only). Once executed, the final result is another vertex, which is transformed to the homogeneous cut space (homogenous clip space). The following table is all the available registers.

Vertex shader (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.