---
title: "TextureElem: TypeShade 셰이더 API의 타입 분류 타입 참조 문서"
description: "TextureElem, TypeShade API의 타입 분류에 속하는 타입입니다. 샘플링되는 텍스처의 요소 타입입니다. WGSL의 texture_2d<T> 타입 매개변수이거나 GLSL ES 3.00의 샘플러 접두사입니다."
url: https://typeshade.dev/ko/api/textureelem/
language: ko
---

# `TextureElem`

타입, 타입 분류

샘플링되는 텍스처의 요소 타입입니다. WGSL의 `texture_2d`<T> 타입 매개변수이거나 GLSL ES 3.00의 샘플러 접두사입니다.

`import type { TextureElem } from 'typeshade'`
`import type { TextureElem } from 'typeshade/core/ir'`

설명은 커밋 af54ddad5의 검토된 컴파일러 문서를 번역한 것입니다. 시그니처와 예제 코드는 원문을 따르며, 필요한 경우 설명에 편집상 수정이 반영됩니다.

## 구문

```ts
type TextureElem = 'f32' | 'u32' | 'i32';
```

## 설명

세 가지 모두 두 타깃에서 코어 사양입니다.

정수 텍스처는 필터링할 수 없습니다. 정수 텍셀을 보간하는 것은 정의되어 있지 않으며, WGSL은 `texture_2d<u32>`에 대한 `textureSample`을 거부합니다. GLSL은 최근접 필터링을 쓰면 `texture(usampler2D, …)`를 받아들입니다. 그러나 WebGL2에서는 컴파일되지만 WebGPU에서는 표현할 수 없는 구문은, 두 타깃용 코드를 한 번만 작성하는 방식이 막으려는 대상입니다.

정수 텍스처는 [`textureLoad`](https://typeshade.dev/ko/api/textureload/), [`textureDimensions`](https://typeshade.dev/ko/api/texturedimensions/), [`textureNumLayers`](https://typeshade.dev/ko/api/texturenumlayers/)로 읽습니다. 정수 키에 쓰는 [`textureSample`](https://typeshade.dev/ko/api/texturesample/)과 [`textureSampleLevel`](https://typeshade.dev/ko/api/texturesamplelevel/)은 `tsc` 오류입니다.

## 함께 보기

- [`textureLoad`](https://typeshade.dev/ko/api/textureload/)
- [`textureDimensions`](https://typeshade.dev/ko/api/texturedimensions/)
- [`textureNumLayers`](https://typeshade.dev/ko/api/texturenumlayers/)
- [`textureSample`](https://typeshade.dev/ko/api/texturesample/)
- [`textureSampleLevel`](https://typeshade.dev/ko/api/texturesamplelevel/)

## 소스

[`src/core/ir/types/storage-texture.ts`, 14행](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/types/storage-texture.ts#L14), 커밋 af54ddad5 기준
