Skip to main content

Interface: DataTextureOptions

Hierarchy​

Table of contents​

Properties​

Properties​

data​

• data: any

Defined in​

src/core/DataTexture.ts:5


id​

• id: string

Inherited from​

TextureOptions.id

Defined in​

src/core/Resource.ts:10


name​

• name: string

Inherited from​

TextureOptions.name

Defined in​

src/core/Resource.ts:11


handle​

• handle: any

Inherited from​

TextureOptions.handle

Defined in​

src/core/Resource.ts:12


userData​

• userData: any

Inherited from​

TextureOptions.userData

Defined in​

src/core/Resource.ts:13


target​

• target: number

默认为 gl.TEXTURE_2D

Inherited from​

TextureOptions.target

Defined in​

src/core/Texture.ts:9


width​

• width: number

纹理宽度,默认为 0

Inherited from​

TextureOptions.width

Defined in​

src/core/Texture.ts:14


height​

• height: number

纹理高度,默认为 0

Inherited from​

TextureOptions.height

Defined in​

src/core/Texture.ts:19


magFilter​

• magFilter: number

纹理放大时使用的过滤类型。 可能的值:gl.NEAREST,gl.LINEAR

Inherited from​

TextureOptions.magFilter

Defined in​

src/core/Texture.ts:25


minFilter​

• minFilter: number

纹理缩小时使用的过滤类型。 可能的值:gl.NEAREST,gl.LINEAR

Inherited from​

TextureOptions.minFilter

Defined in​

src/core/Texture.ts:31


wrapS​

• wrapS: number

水平采样纹理时使用的行为。 可能的值:gl.REPEAT,gl.MIRRORED_REPEAT,gl.CLAMP_TO_EDGE

Inherited from​

TextureOptions.wrapS

Defined in​

src/core/Texture.ts:37


wrapT​

• wrapT: number

垂直采样纹理时使用的行为。 可能的值:gl.REPEAT,gl.MIRRORED_REPEAT,gl.CLAMP_TO_EDGE

Inherited from​

TextureOptions.wrapT

Defined in​

src/core/Texture.ts:43


format​

• format: number

纹理数据的格式,在 WebGL 1 中,它必须与 internalformat 相同。 可能的值:gl.RGBA,gl.RGB,gl.LUMINANCE,gl.LUMINANCE_ALPHA

Inherited from​

TextureOptions.format

Defined in​

src/core/Texture.ts:49


internalFormat​

• internalFormat: number

用于指定纹理图像的内部格式 可能的值:gl.RGBA,gl.RGB,gl.ALPHA 等等

Inherited from​

TextureOptions.internalFormat

Defined in​

src/core/Texture.ts:55


type​

• type: number

指定纹理数据的数据类型。 可能的值:gl.UNSIGNED_BYTE,gl.FLOAT,gl.UNSIGNED_SHORT,gl.UNSIGNED_INT 等等

Inherited from​

TextureOptions.type

Defined in​

src/core/Texture.ts:61


generateMipmaps​

• generateMipmaps: boolean

配置是否启用 mipmap,默认为true generateMipmaps会自动生成若干小尺寸的纹理,根据当前三维物体在屏幕上的大小来自动选择最合适的尺寸。 在 webgl2 使用mipmap 不再强制要求纹理的长度和宽度必须是2的整数次幂。

Inherited from​

TextureOptions.generateMipmaps

Defined in​

src/core/Texture.ts:68


flipY​

• flipY: boolean

设置纹理上传时是否翻转 Y 轴,默认为 false

Inherited from​

TextureOptions.flipY

Defined in​

src/core/Texture.ts:73


anisotropy​

• anisotropy: number

沿通过具有最高纹理像素密度的像素的坐标轴取样的数量。默认情况下,此值为 1。 较高的值会产生比基本mipmap更少的模糊结果,但需要使用更多纹理样本。通常我们在实现让物体缩小时 获取更高的清晰度,可以将此值设大,注意需要 gl.getParameter(ext.MAX_TEXTURE_MAX_ANISOTROPY_EXT) 获取允许的最大值。(see: https://developer.mozilla.org/en-US/docs/Web/API/EXT_texture_filter_anisotropic)

Inherited from​

TextureOptions.anisotropy

Defined in​

src/core/Texture.ts:81


unpackAlignment​

• unpackAlignment: number

指定内存中每个像素行起点的对齐要求。 可能的值: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)

Inherited from​

TextureOptions.unpackAlignment

Defined in​

src/core/Texture.ts:87


premultiplyAlpha​

• premultiplyAlpha: boolean

设置纹理上传时是否预乘 alpha 值,默认为 false

Inherited from​

TextureOptions.premultiplyAlpha

Defined in​

src/core/Texture.ts:92


level​

• level: number

指定mipmap的精细度,级别 0 是基础图像级别,级别 n 是第 n 个 mipmap 缩减级别。默认为 0。

Inherited from​

TextureOptions.level

Defined in​

src/core/Texture.ts:97


offset​

• Optional offset: number

GLintptr 类型偏移到 WebGLBuffer 的数据存储中。用于上传数据到当前范围 WebGLTexture 从WebGLBuffer 范围到PIXEL_UNPACK_BUFFER 目标

Inherited from​

TextureOptions.offset

Defined in​

src/core/Texture.ts:102


image​

• image: any

纹理数据

Inherited from​

TextureOptions.image

Defined in​

src/core/Texture.ts:107