---
title: "vec4u in WGSL, GLSL and TypeShade: shader type reference"
description: "vec4u is vec4<u32> in WGSL and uvec4 in GLSL ES 3.00. A four-component vector of u32."
url: https://typeshade.dev/reference/types/vec4u/
language: en
---

# `vec4u`

Type

A four-component vector of `u32`.

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

## Syntax

```ts
interface vec4u {
  readonly [vecTag]: readonly ['u32', 4]
  [index: number]: u32
  x: u32
  y: u32
  z: u32
  w: u32
  r: u32
  g: u32
  b: u32
  a: u32
  …
}
```

The `…` line stands for 672 more members, the swizzles. A swizzle reads two to four components as a new vector of the same element type. The components come in any order and may repeat, and their letters come from one set, `xyzw` or `rgba`.

## Examples

- [`gallery/compute-reduction-twin/compute-reduction-twin.shade.ts`](https://typeshade.dev/guide/examples/compute-reduction-twin/)
- [`gallery/packed-bytes/packed-bytes.shade.ts`](https://typeshade.dev/guide/examples/packed-bytes/)

## See also

- [Types](https://typeshade.dev/reference/types/)
- [`vec4u()` in `typeshade/core/ir`](https://typeshade.dev/api/vec4u/)
