vs_4_0
Keywords: vs_4_0, NVIDIA, NVIDIA Cg Toolkit, Cg Toolkit, Shader, Shader Programming, GPU Shader Programming, GPU Program

> ## Name

> vs_4_0 - Translation profile to DirectX 10's High Level Shader Language for vertex shaders.

> ## Synopsis

>       vs_4_0

> ## Description

> This Direct3D profile translates Cg into DirectX 10's High Level Shader Language (HLSL10) for vertex shaders.

> The compiler output for this profile conforms to the textual high-level language defined by DirectX 10's High Level Shading Language.

> The limitations of the vs_4_0 profile depend on what HLSL profile to which the translated HLSL code is compiled.

> ## 3D Api Dependencies

> Requires Direct3D 10 support.

>       http://msdn.microsoft.com/en-us/library/bb509657.aspx

> ## Profile Options

> -po pad16 This will add padding variables to the cbuffer declarations to match the 16 byte padding the GP4 OpenGL profiles use. This makes sure each variable in the cbuffer uses an entire float4 constant instead of the tight packing HLSL10 normally uses.

> ## Data Types

> In general, the Cg data types translate to the HLSL10 data types with the same name.

> float, half, fixed
>   These numeric data types all correspond to standard IEEE 754 single-precision floating-point encoding with a sign bit, 23 mantissa bits, and 8 exponent bits (biased by 128), sometimes called s10e5.
> int
>   This integral data type operates like an integer over the -2^24 to 2^24 range. The result of int by int division is an integer (rounding down) to match C.

> ## Semantics

> ## Input Semantics

>     Binding Semantics Name           Corresponding Data

>     POSITION                         Object-space position (SV_Position)

>     NORMAL                           Object-space normal

>     COLOR                            Primary color (float4) (SV_Target)
>     COLOR0
>     DIFFUSE

>     COLOR1                           Secondary color (float4)
>     SPECULAR

>     FOGCOORD                         Fog coordinate

>     TEXCOORD#                        Texture coordinate set #

> ## Uniform Input Semantics

> Sixteen texture units are supported:

>     Binding Semantic Name            Corresponding Data

>     TEXUNIT0                         Texture unit 0
>     TEXUNIT1                         Texture unit 1
>     ...
>     TEXUNIT15                        Texture unit 15

> ## Output Semantics

>     Binding Semantics Name        Corresponding Data

>     POSITION, HPOS                Output position

>     PSIZE, PSIZ                   Output point size

>     FOG, FOGC                     Output fog coordinate

>     COLOR0, COL0                  Output primary color

>     COLOR1, COL1                  Output secondary color

>     BCOL0                         Output backface primary color

>     BCOL1                         Output backface secondary color

>     TEXCOORD0-TEXCOORD7,          Output texture coordinates
>     TEX0-TEX7

>     CLP0-CL5                      Output Clip distances

> ## Standard Library Issues

> This profile is limited to standard library support available in HLSL10 for vertex shaders. In general, the Cg and HLSL10 standard libraries are very similar.

> ## See Also

> gs_4_0, ps_4_0