# GetGPUProjectionMatrix(Matrix4x4, bool)

> Compute GPU projection matrix from camera's projection matrix.

## Definition

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

```csharp
public static Matrix4x4 GetGPUProjectionMatrix(Matrix4x4 proj, bool renderIntoTexture)
```

### Parameters

**** (\[Matrix4x4]\(/engine/6000.6/script-reference/unityengine/matrix4x4)): Source projection matrix.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Will this projection be used for rendering into a RenderTexture?

### Returns

| Type                                                                  | Description                                              |
| --------------------------------------------------------------------- | -------------------------------------------------------- |
| [Matrix4x4](/engine/6000.6/script-reference/unityengine/matrix4x4.md) | Adjusted projection matrix for the current graphics API. |

### Remarks

In Unity, projection matrices follow OpenGL convention. However on some platforms they have to be transformed a bit to match the native API requirements. Use this function to calculate how the final projection matrix will be like. The value will match what comes as `UNITY_MATRIX_P` matrix in a shader.

The `renderIntoTexture` value should be set to true if you intend to render into a [RenderTexture](/engine/6000.6/script-reference/unityengine/rendertexture.md) with this projection matrix. On some platforms it affects how the final matrix will look like.

Additional Resources: [Camera.projectionMatrix](/engine/6000.6/script-reference/unityengine/camera/projectionmatrix.md), [Matrix4x4.Perspective](/engine/6000.6/script-reference/unityengine/matrix4x4/perspective.md), [Platform differences](/engine/6000.6/manual/materials-and-shaders/shaders/writing-custom/shader-writing/sl/writing-shader-writing-shader-programs-hlsl/sl-platform-differences.md), [Built-in shader variables](/engine/6000.6/manual/materials-and-shaders/shaders/reference/sl-unity-shader-variables.md).
