# Tangent

> The direction tangential to the surface at the vertex position.

## Definition

* **Type:** Field
* **Namespace:** [UnityEngine.Rendering](/engine/6000.6/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
Tangent = 2
```

### Remarks

This attribute is optional but plays an important role, for example, in advanced lighting and texture mapping effects such as normal mapping.

Tangents are commonly represented using the [Vector4](/engine/6000.6/script-reference/unityengine/vector4.md) format, which consists of four 32-bit floating-point values, resulting in 16 bytes per vertex. If [vertex compression](/engine/6000.6/manual/analysis/graphics-performance-profiling/compressing-mesh-data-optimization/configure-vertex-compression.md) is applied to this attribute, each component is compressed to 16-bit floating-point values, reducing the total to 8 bytes per vertex.

This attribute corresponds to the `TANGENT` semantic in the HLSL shading language.

You can access vertex tangents using methods such as [Mesh.GetTangents](/engine/6000.6/script-reference/unityengine/mesh/gettangents.md) and [Mesh.SetTangents](/engine/6000.6/script-reference/unityengine/mesh/settangents.md).

For more information, refer to [mesh vertex data](/engine/6000.6/manual/assets-and-media/asset-types/mesh/get-started-with-meshes/anatomyofa/vertex-data.md).
