What does this error mean?

I am working on a Unity shader and I got this error:

Vertex program ‘vertex_main’: unknown input semantics BINORMAL/0

What does it mean and how do I fix it?

As the error states, Unity doesn’t recognise the BINORMAL semantic you’re using for the “B” member of the input to the vertex shader. As described here, vertex data must be described by one of the following semantics:

  • POSITION is the vertex position,
    typically a float4.
  • NORMAL is the vertex normal, typically a float3.
  • TEXCOORD0 is the first UV coordinate, typically a
  • TEXCOORD1 … TEXCOORD3 are the 2nd…4th UV coordinates.
  • TANGENT is the tangent vector (used for normal mapping), typically
    a float4.
  • COLOR is the per-vertex color, typically a float4.

If you want the binormal, you can calculate that in the vertex shader from the NORMAL and TANGENT as:

v2f vert (appdata v) {
    float3 binormal = cross( v.normal, v.tangent.xyz ) * v.tangent.w;