# ComputeDirectionalShadowMatricesAndCullingPrimitives(int, int, int, Vector3, int, float, out Matrix4x4, out Matrix4x4, out ShadowSplitData)

> Calculates the view and projection matrices and shadow split data for a directional light.

## Definition

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

## ComputeDirectionalShadowMatricesAndCullingPrimitives(int, int, int, Vector3, int, float, Matrix4x4, Matrix4x4, ShadowSplitData)

```csharp
public bool ComputeDirectionalShadowMatricesAndCullingPrimitives(int activeLightIndex, int splitIndex, int splitCount, Vector3 splitRatio, int shadowResolution, float shadowNearPlaneOffset, out Matrix4x4 viewMatrix, out Matrix4x4 projMatrix, out ShadowSplitData shadowSplitData)
```

### Parameters

**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The index into the active light array.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The cascade index.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of cascades.**** (\[Vector3]\(/engine/6000.5/script-reference/unityengine/vector3)): The cascade ratios.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The resolution of the shadowmap.**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): The near plane offset for the light.**** (\[Matrix4x4]\(/engine/6000.5/script-reference/unityengine/matrix4x4)): The computed view matrix.**** (\[Matrix4x4]\(/engine/6000.5/script-reference/unityengine/matrix4x4)): The computed projection matrix.**** (\[ShadowSplitData]\(/engine/6000.5/script-reference/unityengine/rendering/shadowsplitdata)): The computed cascade data.

### Returns

| Type                                                          | Description                                                                        |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | If false, the shadow map for this cascade does not need to be rendered this frame. |

### Remarks

Additional Resources: [ShadowSplitData](/engine/6000.5/script-reference/unityengine/rendering/shadowsplitdata.md).
