Skip to content

Vertex Shader Semantics

Zack edited this page Nov 26, 2024 · 2 revisions

The syntax for each parameter is type name : semantic

The type is optional, and the semantics are case-insensitive


The semantics are:

  • POSITION

    Can be called POSITION, VPOS, or SV_Position
    The type is float3 by default
    The parameter holds the position of the vertex in local space


  • NORMAL

    Must be called NORMAL
    The type is float3 by default
    The parameter holds the direction facing away from the surface of the mesh at the given point, in local space


  • COLOR

    Can be called COLOR or SV_Target
    The type is float4 by default
    The parameter holds the diffuse colour given to each vertex, this one will depend on the shader


  • TEXCOORD

    This one can have an index at the end like TEXCOORD0 or TEXCOORD1
    The type is float2 by default
    The parameter holds the UV coordinates of the given vertex.

Clone this wiki locally