# NameToRenderingLayer(string)

> Given a rendering layer name, returns the rendering layer index as defined in the Tags and Layers manager.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static int NameToRenderingLayer(string layerName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Provide a rendering layer name.

### Returns

| Type                                                       | Description              |
| ---------------------------------------------------------- | ------------------------ |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | Returns -1 if not found. |

### Examples

```csharp
using UnityEngine;
using UnityEngine.Rendering;

public class Example : MonoBehaviour
{
    void Start()
    {
        // Prints the name of the rendering layer 1

        Debug.Log(RenderingLayerMask.NameToRenderingLayer("Default"));
    }
}
```
