@vis-three/module-texture
TypeScript icon, indicating that this package has built-in type declarations

0.7.1 • Public • Published

@vis-three/module-texture

最新版本

version

license

NPM

模块信息

module.type

  • : texture

module.object

  • : false

module.lifeOrder

  • : 0

提供配置

纹理基类-Texture

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;
}
  • 默认配置:
{
  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
  • 配置类型:
export interface ImageTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的图片资源地址 */
  url: string;
}
  • 默认配置:
{
  url: "",
  minFilter: LinearFilter,
}

视频纹理-VideoTexture

  • 类型VideoTexture
  • 配置类型:
export interface VideoTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的视频资源地址 */
  url: string;
}
  • 默认配置:
{
  url: "",
  minFilter: LinearFilter,
}

立方体纹理-CubeTexture

  • 类型CubeTexture
  • 配置类型:
export interface CubeTextureConfig extends TextureConfig {
  cube: {
    /**通过resourceManager 解析的图片资源地址 */
    nx: string;
    /**通过resourceManager 解析的图片资源地址 */
    ny: string;
    /**通过resourceManager 解析的图片资源地址 */
    nz: string;
    /**通过resourceManager 解析的图片资源地址 */
    px: string;
    /**通过resourceManager 解析的图片资源地址 */
    py: string;
    /**通过resourceManager 解析的图片资源地址 */
    pz: string;
  };
}
  • 默认配置:
{
  cube: {
    nx: "",
    ny: "",
    nz: "",
    px: "",
    py: "",
    pz: "",
  },
  mapping: CubeReflectionMapping,
  flipY: false,
}

canvas 纹理-CanvasTexture

  • 类型CanvasTexture
  • 配置类型:
export interface CanvasTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的canvas资源地址 */
  url: string;
  /**如果canvas资源更新,你可以通过此属性为true更新 */
  needsUpdate: boolean;
}
  • 默认配置:
{
  url: "",
  needsUpdate: false,
}

加载纹理-LoadTexture

  • 类型LoadTexture
  • 配置类型:
export interface LoadTextureConfig extends TextureConfig {
  /**通过resourceManager 解析的纹理资源地址 */
  url: string;
}
  • 默认配置:
{
  url: "",
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vis-three/module-texture

Weekly Downloads

2

Version

0.7.1

License

MPL-2.0

Unpacked Size

59.2 kB

Total Files

19

Last publish

Collaborators

  • shiotsuki_