# SetTextureFromGlobal

> Binds a global texture to a RayTracingShader.

## Definition

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

## SetTextureFromGlobal(int, int)

Binds a global texture to a [RayTracingShader](/engine/6000.5/script-reference/unityengine/rendering/raytracingshader.md).

```csharp
public void SetTextureFromGlobal(int nameID, int globalTextureNameID)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the texture as given by Shader.PropertyToID.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The ID of the global resource as given by Shader.PropertyToID.

### Remarks

The global texture must be previously set using [Shader.SetGlobalTexture](/engine/6000.5/script-reference/unityengine/shader/setglobaltexture.md).

## SetTextureFromGlobal(string, string)

Binds a global texture to a [RayTracingShader](/engine/6000.5/script-reference/unityengine/rendering/raytracingshader.md).

```csharp
public void SetTextureFromGlobal(string name, string globalTextureName)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the texture to bind.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The name of the global resource to bind to the RayTracingShader.

### Remarks

The global texture must be previously set using [Shader.SetGlobalTexture](/engine/6000.5/script-reference/unityengine/shader/setglobaltexture.md).
