# MainTexture

> Signifies that value of this property contains the main texture of the Material.

## Definition

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

```csharp
MainTexture = 128
```

### Remarks

This flag corresponds to the `[MainTexture]` [ShaderLab Properties attribute](/engine/6000.0/manual/materials-and-shaders/shaders/reference/sl-reference/sl-shader-object/sl-properties.md).

By default, Unity considers a texture with the property name name `"_MainTex"` to be the main texture. Use the `[MainTexture]` ShaderLab Properties attribute to make Unity consider a texture with a different property name to be the main texture.

Additional Resources: [Material.mainTexture](/engine/6000.0/script-reference/unityengine/material/maintexture.md), [ShaderLab: Properties](/engine/6000.0/manual/materials-and-shaders/shaders/reference/sl-reference/sl-shader-object/sl-properties.md), [ShaderPropertyFlags.MainColor](/engine/6000.0/script-reference/unityengine/rendering/shaderpropertyflags/maincolor.md).
