---
title: "mat2 in WGSL, GLSL and TypeShade: shader type reference"
description: "mat2 is mat2x2<f32> in WGSL and mat2 in GLSL ES 3.00. 2x2 matrix of f32, column-major, same type as mat2x2."
url: https://typeshade.dev/reference/types/mat2/
language: en
---

# `mat2`

Type

2x2 matrix of `f32`, column-major, same type as `mat2x2`.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
type mat2<T extends f32 | f64 = f32> = mat2x2<T>
```

## Parameters

- `T` optional `f32 | f64`

## Examples

- [`gallery/capsule-corp-namek-class/capsule-corp-namek-class.shade.ts`](https://typeshade.dev/guide/examples/capsule-corp-namek-class/)

## See also

- [Types](https://typeshade.dev/reference/types/)
