Class: Uint8ArrayTexture
create texture by number array, which format is uint8
Hierarchy
↳
Uint8ArrayTexture
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
- init
- getMipmapCount
- getGPUTexture
- getGPUView
- bindStateChange
- unBindStateChange
- destroy
- delayDestroyTexture
- destroyTexture
- create
- updateTexture
Constructors
constructor
• new Uint8ArrayTexture(width?, height?, numberLayer?): Uint8ArrayTexture
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 |
Returns
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:202
Properties
name
• name: string
name of texture
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:15
url
• url: string
source url
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:20
pid
• pid: number
Return index in texture array
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:30
view
• view: GPUTextureView | GPUExternalTexture
GPUTextureView
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:35
gpuSampler
• gpuSampler: GPUSampler
GPUSampler
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:40
gpuSampler_comparison
• gpuSampler_comparison: GPUSampler
GPUSampler for comparison
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:45
format
• format: GPUTextureFormat
GPUTextureFormat
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:50
usage
• usage: number
GPUTextureUsage
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:55
width
• width: number = 4
texture width
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:60
height
• height: number = 4
texture height
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:65
depthOrArrayLayers
• depthOrArrayLayers: number = 1
depth or layers, default value is 1
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:70
numberLayer
• numberLayer: number = 1
depth or layers, default value is 1
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:75
viewDescriptor
• viewDescriptor: GPUTextureViewDescriptor
GPUTextureViewDescriptor
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:80
textureDescriptor
• textureDescriptor: GPUTextureDescriptor
GPUTextureDescriptor
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:85
visibility
• visibility: number
GPUShaderStage
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:90
textureBindingLayout
• textureBindingLayout: GPUTextureBindingLayout
GPUTextureBindingLayout, contains viewDimension and multisampled
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:96
samplerBindingLayout
• samplerBindingLayout: GPUSamplerBindingLayout
GPUSamplerBindingLayout
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:104
sampler_comparisonBindingLayout
• sampler_comparisonBindingLayout: GPUSamplerBindingLayout
GPUSamplerBindingLayout
Inherited from
Texture.sampler_comparisonBindingLayout
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:111
flipY
• flipY: boolean
whether to flip the image on the y-axis
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:118
isVideoTexture
• Optional isVideoTexture: boolean
whether is video texture
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:123
isHDRTexture
• Optional isHDRTexture: boolean
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:124
mipmapCount
• mipmapCount: number = 1
mipmap Count, default value is 1
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:191
Accessors
useMipmap
• get useMipmap(): boolean
enable/disable mipmap
Returns
boolean
Inherited from
Texture.useMipmap
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:315
• set useMipmap(value): void
get mipmap
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
Texture.useMipmap
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:322
sourceImageData
• get sourceImageData(): HTMLCanvasElement | ImageBitmap | OffscreenCanvas
Returns
HTMLCanvasElement | ImageBitmap | OffscreenCanvas
Inherited from
Texture.sourceImageData
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:353
addressModeU
• get addressModeU(): GPUAddressMode
Returns
GPUAddressMode
Inherited from
Texture.addressModeU
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:438
• set addressModeU(value): void
Parameters
| Name | Type |
|---|---|
value | GPUAddressMode |
Returns
void
Inherited from
Texture.addressModeU
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:442
addressModeV
• get addressModeV(): GPUAddressMode
Returns
GPUAddressMode
Inherited from
Texture.addressModeV
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:449
• set addressModeV(value): void
Parameters
| Name | Type |
|---|---|
value | GPUAddressMode |
Returns
void
Inherited from
Texture.addressModeV
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:453
addressModeW
• get addressModeW(): GPUAddressMode
Returns
GPUAddressMode
Inherited from
Texture.addressModeW
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:460
• set addressModeW(value): void
Parameters
| Name | Type |
|---|---|
value | GPUAddressMode |
Returns
void
Inherited from
Texture.addressModeW
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:464
magFilter
• get magFilter(): GPUFilterMode
Returns
GPUFilterMode
Inherited from
Texture.magFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:471
• set magFilter(value): void
Parameters
| Name | Type |
|---|---|
value | GPUFilterMode |
Returns
void
Inherited from
Texture.magFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:475
minFilter
• get minFilter(): GPUFilterMode
Returns
GPUFilterMode
Inherited from
Texture.minFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:482
• set minFilter(value): void
Parameters
| Name | Type |
|---|---|
value | GPUFilterMode |
Returns
void
Inherited from
Texture.minFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:486
mipmapFilter
• get mipmapFilter(): GPUMipmapFilterMode
Returns
GPUMipmapFilterMode
Inherited from
Texture.mipmapFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:493
• set mipmapFilter(value): void
Parameters
| Name | Type |
|---|---|
value | GPUMipmapFilterMode |
Returns
void
Inherited from
Texture.mipmapFilter
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:497
lodMinClamp
• get lodMinClamp(): number
Returns
number
Inherited from
Texture.lodMinClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:504
• set lodMinClamp(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Inherited from
Texture.lodMinClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:508
lodMaxClamp
• get lodMaxClamp(): number
Returns
number
Inherited from
Texture.lodMaxClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:515
• set lodMaxClamp(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Inherited from
Texture.lodMaxClamp
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:519
compare
• get compare(): GPUCompareFunction
Returns
GPUCompareFunction
Inherited from
Texture.compare
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:526
• set compare(value): void
Parameters
| Name | Type |
|---|---|
value | GPUCompareFunction |
Returns
void
Inherited from
Texture.compare
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:530
maxAnisotropy
• get maxAnisotropy(): number
Returns
number
Inherited from
Texture.maxAnisotropy
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:537
• set maxAnisotropy(value): void
Parameters
| Name | Type |
|---|---|
value | number |
Returns
void
Inherited from
Texture.maxAnisotropy
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:541
Methods
init
▸ init(): this
Returns
this
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:215
getMipmapCount
▸ getMipmapCount(): number
Returns
number
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:357
getGPUTexture
▸ getGPUTexture(): GPUTexture
create or get GPUTexture
Returns
GPUTexture
GPUTexture
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:384
getGPUView
▸ getGPUView(index?): GPUTextureView | GPUExternalTexture
create or get GPUTextureView
Parameters
| Name | Type | Default value |
|---|---|---|
index | number | 0 |
Returns
GPUTextureView | GPUExternalTexture
GPUTextureView | GPUExternalTexture
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:395
bindStateChange
▸ bindStateChange(fun, ref): void
Parameters
| Name | Type |
|---|---|
fun | Function |
ref | any |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:408
unBindStateChange
▸ unBindStateChange(ref): void
Parameters
| Name | Type |
|---|---|
ref | any |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:412
destroy
▸ destroy(force?): void
release the texture
Parameters
| Name | Type |
|---|---|
force? | boolean |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:426
delayDestroyTexture
▸ delayDestroyTexture(tex): void
Parameters
| Name | Type |
|---|---|
tex | GPUTexture |
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:549
destroyTexture
▸ destroyTexture(): void
Returns
void
Inherited from
Defined in
src/gfx/graphics/webGpu/core/texture/Texture.ts:555
create
▸ create(width, height, data, useMipmap?): this
create texture by number array, which format is uint8
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
width | number | undefined | width of texture |
height | number | undefined | height of texture |
data | Uint8Array | undefined | uint8 array |
useMipmap | boolean | false | whether or not gen mipmap |
Returns
this
Defined in
src/textures/Uint8ArrayTexture.ts:22
updateTexture
▸ updateTexture(width, height, data): void
validate the change of this texture
Parameters
| Name | Type |
|---|---|
width | number |
height | number |
data | Uint8Array |
Returns
void

