---
title: "vec2u: WGSL, GLSL과 TypeShade에서 쓰는 형태와 그 뜻, 셰이더 타입 참조"
description: "TypeShade의 vec2u 타입은 WGSL에서 vec2<u32>, GLSL ES 3.00에서 uvec2 형태로 씁니다. A two-component vector of u32."
url: https://typeshade.dev/ko/reference/types/vec2u/
language: ko
---

# `vec2u`

타입

A two-component vector of `u32`.

시그니처와 이름 아래 문장, 컴파일러 메시지는 커밋 af54ddad5의 컴파일러가 쓴 영어 원문입니다.

## 구문

```ts
interface vec2u {
  readonly [vecTag]: readonly ['u32', 2]
  [index: number]: u32
  x: u32
  y: u32
  r: u32
  g: u32
  …
}
```

`…` 줄은 생략된 멤버 56개를 나타내며, 모두 스위즐입니다. 스위즐은 성분을 두 개에서 네 개까지 골라 원래 벡터와 같은 원소 타입의 새 벡터로 읽습니다. 성분 순서는 자유롭고 같은 성분을 반복해도 되지만, 글자는 `xyzw`나 `rgba` 한쪽에서만 골라야 합니다.

## 예제

- [`gallery/integer-math/integer-math.shade.ts`](https://typeshade.dev/ko/guide/examples/integer-math/)
- [`gallery/packing-bitcast/packing-bitcast.shade.ts`](https://typeshade.dev/ko/guide/examples/packing-bitcast/)
- [`gallery/workgroup-tile-2d/workgroup-tile-2d.shade.ts`](https://typeshade.dev/ko/guide/examples/workgroup-tile-2d/)

## 함께 보기

- [타입](https://typeshade.dev/ko/reference/types/)
- [`typeshade/core/ir`의 `vec2u()`](https://typeshade.dev/ko/api/vec2u/)
