# @vis-three/module-texture

> vis-three texture module

Latest version **0.7.1** (published 2024-10-24) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install @vis-three/module-texture
pnpm add @vis-three/module-texture
yarn add @vis-three/module-texture
bun add @vis-three/module-texture
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2024-10-24 |
| First published | 2023-03-28 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 57.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shiotsuki_ |
| Maintainers | shiotsuki_ |

## Links

- npm: https://www.npmjs.com/package/@vis-three/module-texture
- npm.io page: https://npm.io/package/@vis-three/module-texture

## Dependencies (4)

- [@vis-three/core](https://npm.io/package/@vis-three/core.md) ^0.7.0
- [@vis-three/tdcm](https://npm.io/package/@vis-three/tdcm.md) ^0.7.1
- [@vis-three/utils](https://npm.io/package/@vis-three/utils.md) ^0.7.0
- [@vis-three/convenient](https://npm.io/package/@vis-three/convenient.md) ^0.7.0

## Recent versions

- 0.7.1 (latest) — 2024-10-24
- 0.7.0 — 2024-09-11
- 0.6.3 — 2023-09-15
- 0.6.2 — 2023-07-22
- 0.6.1 — 2023-04-10
- 0.6.0 — 2023-03-28

## README

# @vis-three/module-texture

## 最新版本

<img alt="version" src="https://img.shields.io/npm/v/@vis-three/module-texture">

## license

<img alt="NPM" src="https://img.shields.io/npm/l/@vis-three/module-texture?color=blue">

## 模块信息

### module.type

- **值**: `texture`

### module.object

- **值**: `false`

### module.lifeOrder

- **值**: 0

## 提供配置

### 纹理基类-Texture

- **类型**：`Texture`
- **参照**：[https://threejs.org/docs/index.html#api/zh/textures/Texture](https://threejs.org/docs/index.html#api/zh/textures/Texture)
- **配置类型**:

```ts
export interface TextureConfig extends SymbolConfig {
  name: string;
  mapping: number;
  wrapS: number;
  wrapT: number;
  magFilter: number;
  minFilter: number;
  anisotropy: number;
  format: number;
  offset: Vector2Config;
  repeat: Vector2Config;
  rotation: number;
  center: Vector2Config;
  matrixAutoUpdate: boolean;
  encoding: number;
  needsUpdate: boolean;
  flipY: boolean;
}
```

- **默认配置**:

```ts
{
  mapping: UVMapping,
  wrapS: ClampToEdgeWrapping,
  wrapT: ClampToEdgeWrapping,
  magFilter: LinearFilter,
  minFilter: LinearMipmapLinearFilter,
  anisotropy: 1,
  format: RGBAFormat,
  flipY: true,
  offset: {
    x: 0,
    y: 0,
  },
  repeat: {
    x: 1,
    y: 1,
  },
  rotation: 0,
  center: {
    x: 0,
    y: 0,
  },
  matrixAutoUpdate: true,
  encoding: LinearEncoding,
  needsUpdate: false,
}
```

### 图像纹理-ImageTexture

- **类型**：`ImageTexture`
- **配置类型**:

```ts
export interface ImageTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的图片资源地址 */
  url: string;
}
```

- **默认配置**:

```ts
{
  url: "",
  minFilter: LinearFilter,
}
```

### 视频纹理-VideoTexture

- **类型**：`VideoTexture`
- **配置类型**:

```ts
export interface VideoTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的视频资源地址 */
  url: string;
}
```

- **默认配置**:

```ts
{
  url: "",
  minFilter: LinearFilter,
}
```

### 立方体纹理-CubeTexture

- **类型**：`CubeTexture`
- **配置类型**:

```ts
export interface CubeTextureConfig extends TextureConfig {
  cube: {
    /**通过resourceManager 解析的图片资源地址 */
    nx: string;
    /**通过resourceManager 解析的图片资源地址 */
    ny: string;
    /**通过resourceManager 解析的图片资源地址 */
    nz: string;
    /**通过resourceManager 解析的图片资源地址 */
    px: string;
    /**通过resourceManager 解析的图片资源地址 */
    py: string;
    /**通过resourceManager 解析的图片资源地址 */
    pz: string;
  };
}
```

- **默认配置**:

```ts
{
  cube: {
    nx: "",
    ny: "",
    nz: "",
    px: "",
    py: "",
    pz: "",
  },
  mapping: CubeReflectionMapping,
  flipY: false,
}
```

### canvas 纹理-CanvasTexture

- **类型**：`CanvasTexture`
- **配置类型**:

```ts
export interface CanvasTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的canvas资源地址 */
  url: string;
  /**如果canvas资源更新，你可以通过此属性为true更新 */
  needsUpdate: boolean;
}
```

- **默认配置**:

```ts
{
  url: "",
  needsUpdate: false,
}
```

### 加载纹理-LoadTexture

- **类型**：`LoadTexture`
- **配置类型**:

```ts
export interface LoadTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的纹理资源地址 */
  url: string;
}
```

- **默认配置**:

```ts
{
  url: "",
}
```

---
_Source: https://npm.io/package/@vis-three/module-texture · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
