Class: Texture
Texture
Hierarchy
Texture
Implements
GPUSamplerDescriptor
Constructors
Properties
- name
- url
- pid
- view
- gpuSampler
- gpuSampler_comparison
- format
- usage
- width
- height
- depthOrArrayLayers
- numberLayer
- viewDescriptor
- textureDescriptor
- visibility
- textureBindingLayout
- samplerBindingLayout
- sampler_comparisonBindingLayout
- flipY
- isVideoTexture
- isHDRTexture
- mipmapCount
Accessors
- useMipmap
- sourceImageData
- addressModeU
- addressModeV
- addressModeW
- magFilter
- minFilter
- mipmapFilter
- lodMinClamp
- lodMaxClamp
- compare
- maxAnisotropy
Methods
Constructors
constructor
• new Texture(width?
, height?
, numberLayer?
)
Create a texture2D
Parameters
Name | Type | Default value | Description |
---|---|---|---|
width | number | 32 | size of texture width |
height | number | 32 | height of texture width |
numberLayer | number | 1 | number layer of texture |
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:201
Properties
name
• name: string
name of texture
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:14
url
• url: string
source url
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:19
pid
• pid: number
Return index in texture array
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:29
view
• view: GPUTextureView
GPUTextureView
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:34
gpuSampler
• gpuSampler: GPUSampler
GPUSampler
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:39
gpuSampler_comparison
• gpuSampler_comparison: GPUSampler
GPUSampler for comparison
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:44
format
• format: GPUTextureFormat
GPUTextureFormat
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:49
usage
• usage: number
GPUTextureUsage
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:54
width
• width: number
= 4
texture width
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:59
height
• height: number
= 4
texture height
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:64
depthOrArrayLayers
• depthOrArrayLayers: number
= 1
depth or layers, default value is 1
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:69
numberLayer
• numberLayer: number
= 1
depth or layers, default value is 1
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:74
viewDescriptor
• viewDescriptor: GPUTextureViewDescriptor
GPUTextureViewDescriptor
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:79
textureDescriptor
• textureDescriptor: GPUTextureDescriptor
GPUTextureDescriptor
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:84
visibility
• visibility: number
GPUShaderStage
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:89
textureBindingLayout
• textureBindingLayout: GPUTextureBindingLayout
GPUTextureBindingLayout, contains viewDimension and multisampled
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:95
samplerBindingLayout
• samplerBindingLayout: GPUSamplerBindingLayout
GPUSamplerBindingLayout
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:103
sampler_comparisonBindingLayout
• sampler_comparisonBindingLayout: GPUSamplerBindingLayout
GPUSamplerBindingLayout
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:110
flipY
• flipY: boolean
whether to flip the image on the y-axis
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:117
isVideoTexture
• Optional
isVideoTexture: boolean
whether is video texture
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:122
isHDRTexture
• Optional
isHDRTexture: boolean
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:123
mipmapCount
• mipmapCount: number
= 1
mipmap Count, default value is 1
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:190
Accessors
useMipmap
• get
useMipmap(): boolean
enable/disable mipmap
Returns
boolean
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:309
• set
useMipmap(value
): void
get mipmap
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:316
sourceImageData
• get
sourceImageData(): HTMLCanvasElement
| ImageBitmap
| OffscreenCanvas
Returns
HTMLCanvasElement
| ImageBitmap
| OffscreenCanvas
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:347
addressModeU
• get
addressModeU(): GPUAddressMode
Returns
GPUAddressMode
Implementation of
GPUSamplerDescriptor.addressModeU
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:425
• set
addressModeU(value
): void
Parameters
Name | Type |
---|---|
value | GPUAddressMode |
Returns
void
Implementation of
GPUSamplerDescriptor.addressModeU
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:429
addressModeV
• get
addressModeV(): GPUAddressMode
Returns
GPUAddressMode
Implementation of
GPUSamplerDescriptor.addressModeV
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:436
• set
addressModeV(value
): void
Parameters
Name | Type |
---|---|
value | GPUAddressMode |
Returns
void
Implementation of
GPUSamplerDescriptor.addressModeV
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:440
addressModeW
• get
addressModeW(): GPUAddressMode
Returns
GPUAddressMode
Implementation of
GPUSamplerDescriptor.addressModeW
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:447
• set
addressModeW(value
): void
Parameters
Name | Type |
---|---|
value | GPUAddressMode |
Returns
void
Implementation of
GPUSamplerDescriptor.addressModeW
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:451
magFilter
• get
magFilter(): GPUFilterMode
Returns
GPUFilterMode
Implementation of
GPUSamplerDescriptor.magFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:458
• set
magFilter(value
): void
Parameters
Name | Type |
---|---|
value | GPUFilterMode |
Returns
void
Implementation of
GPUSamplerDescriptor.magFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:462
minFilter
• get
minFilter(): GPUFilterMode
Returns
GPUFilterMode
Implementation of
GPUSamplerDescriptor.minFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:469
• set
minFilter(value
): void
Parameters
Name | Type |
---|---|
value | GPUFilterMode |
Returns
void
Implementation of
GPUSamplerDescriptor.minFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:473
mipmapFilter
• get
mipmapFilter(): GPUMipmapFilterMode
Returns
GPUMipmapFilterMode
Implementation of
GPUSamplerDescriptor.mipmapFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:480
• set
mipmapFilter(value
): void
Parameters
Name | Type |
---|---|
value | GPUMipmapFilterMode |
Returns
void
Implementation of
GPUSamplerDescriptor.mipmapFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:484
lodMinClamp
• get
lodMinClamp(): number
Returns
number
Implementation of
GPUSamplerDescriptor.lodMinClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:491
• set
lodMinClamp(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Implementation of
GPUSamplerDescriptor.lodMinClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:495
lodMaxClamp
• get
lodMaxClamp(): number
Returns
number
Implementation of
GPUSamplerDescriptor.lodMaxClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:502
• set
lodMaxClamp(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Implementation of
GPUSamplerDescriptor.lodMaxClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:506
compare
• get
compare(): GPUCompareFunction
Returns
GPUCompareFunction
Implementation of
GPUSamplerDescriptor.compare
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:513
• set
compare(value
): void
Parameters
Name | Type |
---|---|
value | GPUCompareFunction |
Returns
void
Implementation of
GPUSamplerDescriptor.compare
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:517
maxAnisotropy
• get
maxAnisotropy(): number
Returns
number
Implementation of
GPUSamplerDescriptor.maxAnisotropy
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:524
• set
maxAnisotropy(value
): void
Parameters
Name | Type |
---|---|
value | number |
Returns
void
Implementation of
GPUSamplerDescriptor.maxAnisotropy
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:528
Methods
init
▸ init(): Texture
Returns
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:214
getGPUTexture
▸ getGPUTexture(): GPUTexture
create or get GPUTexture
Returns
GPUTexture
GPUTexture
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:371
getGPUView
▸ getGPUView(index?
): GPUTextureView
| GPUExternalTexture
create or get GPUTextureView
Parameters
Name | Type | Default value |
---|---|---|
index | number | 0 |
Returns
GPUTextureView
| GPUExternalTexture
GPUTextureView | GPUExternalTexture
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:382
bindStateChange
▸ bindStateChange(fun
, ref
): void
Parameters
Name | Type |
---|---|
fun | Function |
ref | any |
Returns
void
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:395
unBindStateChange
▸ unBindStateChange(ref
): void
Parameters
Name | Type |
---|---|
ref | any |
Returns
void
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:399
destroy
▸ destroy(force?
): void
release the texture
Parameters
Name | Type |
---|---|
force? | boolean |
Returns
void