Skip to content

Class: Texture

Texture

Hierarchy

Implements

  • GPUSamplerDescriptor

Constructors

Properties

Accessors

Methods

Constructors

constructor

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

Create a texture2D

Parameters

NameTypeDefault valueDescription
widthnumber32size of texture width
heightnumber32height of texture width
numberLayernumber1number layer of texture

Returns

Texture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:202

Properties

name

name: string

name of texture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:15


url

url: string

source url

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:20


pid

pid: number

Return index in texture array

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:30


view

view: GPUTextureView | GPUExternalTexture

GPUTextureView

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:35


gpuSampler

gpuSampler: GPUSampler

GPUSampler

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:40


gpuSampler_comparison

gpuSampler_comparison: GPUSampler

GPUSampler for comparison

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:45


format

format: GPUTextureFormat

GPUTextureFormat

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:50


usage

usage: number

GPUTextureUsage

Defined in

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


width

width: number = 4

texture width

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:60


height

height: number = 4

texture height

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:65


depthOrArrayLayers

depthOrArrayLayers: number = 1

depth or layers, default value is 1

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:70


numberLayer

numberLayer: number = 1

depth or layers, default value is 1

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:75


viewDescriptor

viewDescriptor: GPUTextureViewDescriptor

GPUTextureViewDescriptor

Defined in

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


textureDescriptor

textureDescriptor: GPUTextureDescriptor

GPUTextureDescriptor

Defined in

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


visibility

visibility: number

GPUShaderStage

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:90


textureBindingLayout

textureBindingLayout: GPUTextureBindingLayout

GPUTextureBindingLayout, contains viewDimension and multisampled

Defined in

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


samplerBindingLayout

samplerBindingLayout: GPUSamplerBindingLayout

GPUSamplerBindingLayout

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:104


sampler_comparisonBindingLayout

sampler_comparisonBindingLayout: GPUSamplerBindingLayout

GPUSamplerBindingLayout

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:111


flipY

flipY: boolean

whether to flip the image on the y-axis

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:118


isVideoTexture

Optional isVideoTexture: boolean

whether is video texture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:123


isHDRTexture

Optional isHDRTexture: boolean

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:124


mipmapCount

mipmapCount: number = 1

mipmap Count, default value is 1

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:191

Accessors

useMipmap

get useMipmap(): boolean

enable/disable mipmap

Returns

boolean

Defined in

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

set useMipmap(value): void

get mipmap

Parameters

NameType
valueboolean

Returns

void

Defined in

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


sourceImageData

get sourceImageData(): HTMLCanvasElement | ImageBitmap | OffscreenCanvas

Returns

HTMLCanvasElement | ImageBitmap | OffscreenCanvas

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:353


addressModeU

get addressModeU(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeU

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:438

set addressModeU(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeU

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:442


addressModeV

get addressModeV(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeV

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:449

set addressModeV(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeV

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:453


addressModeW

get addressModeW(): GPUAddressMode

Returns

GPUAddressMode

Implementation of

GPUSamplerDescriptor.addressModeW

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:460

set addressModeW(value): void

Parameters

NameType
valueGPUAddressMode

Returns

void

Implementation of

GPUSamplerDescriptor.addressModeW

Defined in

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


magFilter

get magFilter(): GPUFilterMode

Returns

GPUFilterMode

Implementation of

GPUSamplerDescriptor.magFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:471

set magFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.magFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:475


minFilter

get minFilter(): GPUFilterMode

Returns

GPUFilterMode

Implementation of

GPUSamplerDescriptor.minFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:482

set minFilter(value): void

Parameters

NameType
valueGPUFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.minFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:486


mipmapFilter

get mipmapFilter(): GPUMipmapFilterMode

Returns

GPUMipmapFilterMode

Implementation of

GPUSamplerDescriptor.mipmapFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:493

set mipmapFilter(value): void

Parameters

NameType
valueGPUMipmapFilterMode

Returns

void

Implementation of

GPUSamplerDescriptor.mipmapFilter

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:497


lodMinClamp

get lodMinClamp(): number

Returns

number

Implementation of

GPUSamplerDescriptor.lodMinClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:504

set lodMinClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.lodMinClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:508


lodMaxClamp

get lodMaxClamp(): number

Returns

number

Implementation of

GPUSamplerDescriptor.lodMaxClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:515

set lodMaxClamp(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.lodMaxClamp

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:519


compare

get compare(): GPUCompareFunction

Returns

GPUCompareFunction

Implementation of

GPUSamplerDescriptor.compare

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:526

set compare(value): void

Parameters

NameType
valueGPUCompareFunction

Returns

void

Implementation of

GPUSamplerDescriptor.compare

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:530


maxAnisotropy

get maxAnisotropy(): number

Returns

number

Implementation of

GPUSamplerDescriptor.maxAnisotropy

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:537

set maxAnisotropy(value): void

Parameters

NameType
valuenumber

Returns

void

Implementation of

GPUSamplerDescriptor.maxAnisotropy

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:541

Methods

init

init(): this

Returns

this

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:215


getMipmapCount

getMipmapCount(): number

Returns

number

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:357


getGPUTexture

getGPUTexture(): GPUTexture

create or get GPUTexture

Returns

GPUTexture

GPUTexture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:384


getGPUView

getGPUView(index?): GPUTextureView | GPUExternalTexture

create or get GPUTextureView

Parameters

NameTypeDefault value
indexnumber0

Returns

GPUTextureView | GPUExternalTexture

GPUTextureView | GPUExternalTexture

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:395


bindStateChange

bindStateChange(fun, ref): void

Parameters

NameType
funFunction
refany

Returns

void

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:408


unBindStateChange

unBindStateChange(ref): void

Parameters

NameType
refany

Returns

void

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:412


destroy

destroy(force?): void

release the texture

Parameters

NameType
force?boolean

Returns

void

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:426


delayDestroyTexture

delayDestroyTexture(tex): void

Parameters

NameType
texGPUTexture

Returns

void

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:549


destroyTexture

destroyTexture(): void

Returns

void

Defined in

src/gfx/graphics/webGpu/core/texture/Texture.ts:555

Released under the MIT License