Class: VideoTexture
Defined in: packages/media-extention/VideoTexture.ts:16
Video Texture
Extends
Texture
Constructors
Constructor
new VideoTexture(
ctx?):VideoTexture
Defined in: packages/media-extention/VideoTexture.ts:20
Parameters
ctx?
Context3D
Returns
VideoTexture
Overrides
Texture.constructor
Properties
_boundCtx
_boundCtx:
Context3D=null
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:19
The Context3D this texture is bound to. Set on first GPU use.
Inherited from
Texture._boundCtx
name
name:
string
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:39
name of texture
Inherited from
Texture.name
url
url:
string
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:44
source url
Inherited from
Texture.url
pid
pid:
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:94
Return index in texture array
Inherited from
Texture.pid
format
format:
GPUTextureFormat
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:153
GPUTextureFormat
Inherited from
Texture.format
usage
usage:
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:158
GPUTextureUsage
Inherited from
Texture.usage
width
width:
number=4
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:163
texture width
Inherited from
Texture.width
height
height:
number=4
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:168
texture height
Inherited from
Texture.height
depthOrArrayLayers
depthOrArrayLayers:
number=1
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:173
depth or layers, default value is 1
Inherited from
Texture.depthOrArrayLayers
numberLayer
numberLayer:
number=1
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:178
depth or layers, default value is 1
Inherited from
Texture.numberLayer
viewDescriptor
viewDescriptor:
GPUTextureViewDescriptor
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:183
GPUTextureViewDescriptor
Inherited from
Texture.viewDescriptor
textureDescriptor
textureDescriptor:
GPUTextureDescriptor
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:188
GPUTextureDescriptor
Inherited from
Texture.textureDescriptor
visibility
visibility:
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:193
GPUShaderStage
Inherited from
Texture.visibility
textureBindingLayout
textureBindingLayout:
GPUTextureBindingLayout
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:199
GPUTextureBindingLayout, contains viewDimension and multisampled
Inherited from
Texture.textureBindingLayout
samplerBindingLayout
samplerBindingLayout:
GPUSamplerBindingLayout
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:207
GPUSamplerBindingLayout
Inherited from
Texture.samplerBindingLayout
sampler_comparisonBindingLayout
sampler_comparisonBindingLayout:
GPUSamplerBindingLayout
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:214
GPUSamplerBindingLayout
Inherited from
Texture.sampler_comparisonBindingLayout
flipY
flipY:
boolean
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:221
whether to flip the image on the y-axis
Inherited from
Texture.flipY
isVideoTexture?
optionalisVideoTexture?:boolean
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:226
whether is video texture
Inherited from
Texture.isVideoTexture
isHDRTexture?
optionalisHDRTexture?:boolean
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:230
whether this texture holds HDR (high dynamic range) image data
Inherited from
Texture.isHDRTexture
mipmapCount
mipmapCount:
number=1
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:297
mipmap Count, default value is 1
Inherited from
Texture.mipmapCount
media
media:
HTMLVideoElement
Defined in: packages/media-extention/VideoTexture.ts:17
Accessors
view
Get Signature
get view():
GPUTextureView|GPUExternalTexture
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:101
Returns
GPUTextureView | GPUExternalTexture
Set Signature
set view(
v):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:111
Parameters
v
GPUTextureView | GPUExternalTexture
Returns
void
Inherited from
Texture.view
gpuSampler
Get Signature
get gpuSampler():
GPUSampler
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:120
Returns
GPUSampler
Set Signature
set gpuSampler(
v):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:127
Parameters
v
GPUSampler
Returns
void
Inherited from
Texture.gpuSampler
gpuSampler_comparison
Get Signature
get gpuSampler_comparison():
GPUSampler
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:136
Returns
GPUSampler
Set Signature
set gpuSampler_comparison(
v):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:146
Parameters
v
GPUSampler
Returns
void
Inherited from
Texture.gpuSampler_comparison
useMipmap
Get Signature
get useMipmap():
boolean
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:469
enable/disable mipmap
Returns
boolean
Set Signature
set useMipmap(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:476
get mipmap
Parameters
value
boolean
Returns
void
Inherited from
Texture.useMipmap
sourceImageData
Get Signature
get sourceImageData():
HTMLCanvasElement|ImageBitmap|OffscreenCanvas
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:507
the cached CPU source image used to (re)upload the GPU texture
Returns
HTMLCanvasElement | ImageBitmap | OffscreenCanvas
Inherited from
Texture.sourceImageData
addressModeU
Get Signature
get addressModeU():
GPUAddressMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:621
Sampler address mode for the U (width) texture coordinate.
Returns
GPUAddressMode
Set Signature
set addressModeU(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:625
Parameters
value
GPUAddressMode
Returns
void
Inherited from
Texture.addressModeU
addressModeV
Get Signature
get addressModeV():
GPUAddressMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:635
Sampler address mode for the V (height) texture coordinate.
Returns
GPUAddressMode
Set Signature
set addressModeV(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:639
Parameters
value
GPUAddressMode
Returns
void
Inherited from
Texture.addressModeV
addressModeW
Get Signature
get addressModeW():
GPUAddressMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:649
Sampler address mode for the W (depth) texture coordinate.
Returns
GPUAddressMode
Set Signature
set addressModeW(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:653
Specifies the GPUAddressMode | address modes for the texture width, height, and depth coordinates, respectively.
Parameters
value
GPUAddressMode
Returns
void
Inherited from
Texture.addressModeW
magFilter
Get Signature
get magFilter():
GPUFilterMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:664
Sampling filter used when the sample footprint is smaller than or equal to one texel (magnification).
Returns
GPUFilterMode
Set Signature
set magFilter(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:668
Specifies the sampling behavior when the sampled area is smaller than or equal to one texel.
Parameters
value
GPUFilterMode
Returns
void
Inherited from
Texture.magFilter
minFilter
Get Signature
get minFilter():
GPUFilterMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:679
Sampling filter used when the sample footprint is larger than one texel (minification).
Returns
GPUFilterMode
Set Signature
set minFilter(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:683
Specifies the sampling behavior when the sampled area is larger than one texel.
Parameters
value
GPUFilterMode
Returns
void
Inherited from
Texture.minFilter
mipmapFilter
Get Signature
get mipmapFilter():
GPUMipmapFilterMode
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:693
Filter used when sampling between mipmap levels.
Returns
GPUMipmapFilterMode
Set Signature
set mipmapFilter(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:697
Specifies behavior for sampling between mipmap levels.
Parameters
value
GPUMipmapFilterMode
Returns
void
Inherited from
Texture.mipmapFilter
lodMinClamp
Get Signature
get lodMinClamp():
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:707
Minimum level-of-detail clamp used internally when sampling.
Returns
number
Set Signature
set lodMinClamp(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:711
Parameters
value
number
Returns
void
Inherited from
Texture.lodMinClamp
lodMaxClamp
Get Signature
get lodMaxClamp():
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:721
Maximum level-of-detail clamp used internally when sampling.
Returns
number
Set Signature
set lodMaxClamp(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:725
Specifies the minimum and maximum levels of detail, respectively, used internally when sampling a texture.
Parameters
value
number
Returns
void
Inherited from
Texture.lodMaxClamp
compare
Get Signature
get compare():
GPUCompareFunction
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:735
Comparison function; when set the sampler becomes a comparison sampler.
Returns
GPUCompareFunction
Set Signature
set compare(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:739
When provided the sampler will be a comparison sampler with the specified GPUCompareFunction. Note: Comparison samplers may use filtering, but the sampling results will be implementation-dependent and may differ from the normal filtering rules.
Parameters
value
GPUCompareFunction
Returns
void
Inherited from
Texture.compare
maxAnisotropy
Get Signature
get maxAnisotropy():
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:749
Maximum anisotropy clamp used by the sampler.
Returns
number
Set Signature
set maxAnisotropy(
value):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:753
Specifies the maximum anisotropy value clamp used by the sampler. Anisotropic filtering is enabled when GPUSamplerDescriptor#maxAnisotropy is > 1 and the implementation supports it. Anisotropic filtering improves the image quality of textures sampled at oblique viewing angles. Higher GPUSamplerDescriptor#maxAnisotropy values indicate the maximum ratio of anisotropy supported when filtering.
Parameters
value
number
Returns
void
Inherited from
Texture.maxAnisotropy
Methods
_ensureBound()
_ensureBound(
ctx?):Context3D
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:28
Ensure this texture is bound to a Context3D and return it. Resolution order: explicit arg, prior bindCtx(), then the single-engine default (same contract as Engine3D._defaultContext() for no-arg material constructors). Throws only when the choice is ambiguous — no engine yet, or several engines alive without an explicit ctx.
Parameters
ctx?
Context3D
Returns
Context3D
Inherited from
Texture._ensureBound
init()
init():
this
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:327
Run the optional internal create hooks (binding layout, texture, view, sampler) if a subclass provides them.
Returns
this
this texture, for chaining
Inherited from
Texture.init
getMipmapCount()
getMipmapCount():
number
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:515
Compute the full mipmap chain length for the current texture size.
Returns
number
number of mip levels
Inherited from
Texture.getMipmapCount
bindStateChange()
bindStateChange(
fun,ref):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:573
Register a callback invoked when this texture's GPU resources change.
Parameters
fun
Function
callback to invoke on change
ref
any
owner reference used as the key for later unbinding
Returns
void
Inherited from
Texture.bindStateChange
unBindStateChange()
unBindStateChange(
ref):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:581
Remove a previously registered state-change callback.
Parameters
ref
any
owner reference used when binding the callback
Returns
void
Inherited from
Texture.unBindStateChange
destroy()
destroy(
force?):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:602
release the materialized texture and all GPU slots
Parameters
force?
boolean
Returns
void
Inherited from
Texture.destroy
delayDestroyTexture()
staticdelayDestroyTexture(ctx,tex):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:773
Queue a GPU texture for deferred destruction on the given context.
Parameters
ctx
Context3D
the owning context
tex
GPUTexture
the GPU texture to destroy later
Returns
void
Inherited from
Texture.delayDestroyTexture
destroyTexture()
staticdestroyTexture(ctx):void
Defined in: src/gfx/graphics/webGpu/core/texture/Texture.ts:784
Destroy all GPU textures queued for deferred destruction on the context.
Parameters
ctx
Context3D
the context whose queued textures are destroyed
Returns
void
Inherited from
Texture.destroyTexture
load()
load(
video):Promise<void>
Defined in: packages/media-extention/VideoTexture.ts:32
load one Video Source
Parameters
video
string | HTMLVideoElement | MediaStream
the url of a video source, or a MediaStream object, or a HTMLVideoElement
Returns
Promise<void>
getGPUTexture()
getGPUTexture():
any
Defined in: packages/media-extention/VideoTexture.ts:64
create or get GPUTexture (delegates to the per-context gpuTexture getter, which handles lazy creation + source-image upload).
Returns
any
Overrides
Texture.getGPUTexture
getGPUView()
getGPUView():
GPUExternalTexture
Defined in: packages/media-extention/VideoTexture.ts:72
create or get GPUTextureView (delegates to the per-context view getter, which handles lazy creation from viewDescriptor).
Returns
GPUExternalTexture
Overrides
Texture.getGPUView

