Skip to content
本页内容

Class: Texture

纹理对象

Hierarchy

Implements

  • GPUSamplerDescriptor

Properties

Constructors

Methods

Accessors

Properties

textureSource

Readonly textureSource: SerializeTextureSource

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:13


name

name: string

纹理名称

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:17


url

url: string

纹理来源URL

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:21


pid

pid: number

数组贴图用到时的索引

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:31


view

view: GPUTextureView

纹理视图

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:36


gpuSampler

gpuSampler: GPUSampler

gpu采样器

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:41


gpuSampler_comparison

gpuSampler_comparison: GPUSampler

gpu比较采样器

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:46


format

format: GPUTextureFormat

格式

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:51


usage

usage: number

纹理用途

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:55


width

width: number = 4

纹理宽度,默认为4

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:59


height

height: number = 4

纹理高度,默认为4

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:63


depthOrArrayLayers

depthOrArrayLayers: number = 1

纹理深度或纹理层数,默认为1

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:67


numberLayer

numberLayer: number = 1

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:68


viewDescriptor

viewDescriptor: GPUTextureViewDescriptor

纹理视图描述符

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:72


textureDescriptor

textureDescriptor: GPUTextureDescriptor

纹理描述符

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:76


visibility

visibility: number

纹理可视性

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:80


textureBindingLayout

textureBindingLayout: GPUTextureBindingLayout

绑定纹理,包含viewDimension和multisampled两个参数

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:85


samplerBindingLayout

samplerBindingLayout: GPUSamplerBindingLayout

绑定采样器,包含type参数

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:92


sampler_comparisonBindingLayout

sampler_comparisonBindingLayout: GPUSamplerBindingLayout

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:96


flipY

flipY: boolean

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:101


sourceImageData

sourceImageData: HTMLCanvasElement | ImageBitmap | OffscreenCanvas

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:108


mipmapCount

mipmapCount: number = 1

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:109

Constructors

constructor

new Texture(width?, height?, numberLayer?)

新健纹理

Parameters

NameTypeDefault value
widthnumber32
heightnumber32
numberLayernumber1

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:113

Methods

init

init(): void

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:126


getGPUTexture

getGPUTexture(): GPUTexture

更新gpu纹理

Returns

GPUTexture

返回gpu纹理

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:278


getGPUView

getGPUView(index?): GPUTextureView | GPUExternalTexture

获取gpu视图

Parameters

NameTypeDefault value
indexnumber0

Returns

GPUTextureView | GPUExternalTexture

返回纹理视图

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:289


bindStateChange

bindStateChange(fun, ref): void

Parameters

NameType
funFunction
refany

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:300


unBindStateChange

unBindStateChange(ref): void

Parameters

NameType
refany

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:304


destoryView

destoryView(): void

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:315


destroy

destroy(): void

销毁纹理

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:322


serialization

serialization(): SerializeTextureInstance

Returns

SerializeTextureInstance

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:474


unSerialization

unSerialization(instance): void

Parameters

NameType
instanceSerializeTextureInstance

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:495

Accessors

useMipmap

get useMipmap(): boolean

开启/关闭mipmap的使用

Returns

boolean

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:220

set useMipmap(value): void

开启/关闭mipmap的使用

Parameters

NameType
valueboolean

Returns

void

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:227


addressModeU

get addressModeU(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeU

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:340

set addressModeU(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeU

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:343


addressModeV

get addressModeV(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeV

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:352

set addressModeV(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeV

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:355


addressModeW

get addressModeW(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeW

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:366

set addressModeW(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeW

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:369


magFilter

get magFilter(): GPUFilterMode

Returns

GPUFilterMode

Implementation of

GPUSamplerDescriptor.magFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:380

set magFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.magFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:383


minFilter

get minFilter(): GPUFilterMode

Returns

GPUFilterMode

Implementation of

GPUSamplerDescriptor.minFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:393

set minFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.minFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:396


mipmapFilter

get mipmapFilter(): GPUMipmapFilterMode

Returns

GPUMipmapFilterMode

Implementation of

GPUSamplerDescriptor.mipmapFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:406

set mipmapFilter(value): void

Parameters

NameType
valueGPUMipmapFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.mipmapFilter

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:409


lodMinClamp

get lodMinClamp(): number

Returns

number

Implementation of

GPUSamplerDescriptor.lodMinClamp

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:418

set lodMinClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.lodMinClamp

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:421


lodMaxClamp

get lodMaxClamp(): number

Returns

number

Implementation of

GPUSamplerDescriptor.lodMaxClamp

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:432

set lodMaxClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.lodMaxClamp

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:435


compare

get compare(): GPUCompareFunction

Returns

GPUCompareFunction

Implementation of

GPUSamplerDescriptor.compare

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:448

set compare(value): void

Parameters

NameType
valueGPUCompareFunction

Returns

void

Implementation of

GPUSamplerDescriptor.compare

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:451


maxAnisotropy

get maxAnisotropy(): number

Returns

number

Implementation of

GPUSamplerDescriptor.maxAnisotropy

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:464

set maxAnisotropy(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.maxAnisotropy

Defined in

src/engine/gfx/graphics/webGpu/core/texture/Texture.ts:467