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

# `vec2b`

타입

A two-component vector of `bool`: what comparing two `vec2` values yields, componentwise.

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

## 구문

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

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

## 함께 보기

- [타입](https://typeshade.dev/ko/reference/types/)
