Hilo3d API - v2.0.0
    Preparing search index...

    Class LazyTexture

    Texture that resolves its source through the loader registry on demand.

    Hierarchy (View Summary)

    Index
    _listeners: ListenerMap | null = null
    anisotropic: number = 1

    anisotropic

    autoLoad: boolean = true
    autoUpdate: boolean = false

    是否每次都更新Texture

    border: 0
    className: "LazyTexture" = 'LazyTexture'
    compressed: boolean = false

    是否压缩

    crossOrigin: ImageCrossOrigin = false
    depth: number = 1

    Depth for 3D textures, or the fixed layer count for 2D-array textures.

    flipY: boolean = false

    是否翻转Texture的Y轴

    format: number = RGBA

    图片 Format

    height: number = 0
    id: string
    internalFormat: number = RGBA8

    Texture Internal Format

    isImageCanRelease: boolean = false

    图片资源是否可以释放,可以的话,上传到GPU后将释放图片引用

    The engine keeps a private recovery backing after releasing the public image: raw pixels and ImageData are copied, while DOM/video sources are retained because they cannot be cloned synchronously and portably. Any later WebGL2 context allocation or WebGPU device can rebuild the texture without making the released public image readable again.

    isLazyTexture: true
    isTexture: true
    magFilter: number = LINEAR

    magFilter

    minFilter: number = LINEAR

    minFilter

    mipmaps: TextureMipmap[] | null = null

    mipmaps

    name: string = ''
    needDestroy: boolean = false

    是否需要销毁之前的Texture,Texture参数变更之后需要销毁

    placeHolder: HTMLImageElement | null = null
    premultiplyAlpha: boolean = false
    resType: string = ''
    target: number = TEXTURE_2D

    Texture Target

    type: number = UNSIGNED_BYTE

    类型

    uv

    width: number = 0
    wrapR: number = REPEAT

    R-axis wrap mode used by 3D and 2D-array textures.

    wrapS: number = REPEAT

    wrapS

    wrapT: number = REPEAT

    wrapT

    loader: Loader | null = null
    • get isImageReleased(): boolean

      Whether the CPU image source has already been discarded after a successful upload.

      Returns boolean

    • get mipmapCount(): number

      mipmapCount

      Returns number

    • get needUpdate(): boolean

      是否需要更新Texture

      Returns boolean

    • set needUpdate(value: boolean): void

      Parameters

      • value: boolean

      Returns void

    • get origHeight(): number

      获取原始图像高度。

      Returns number

    • get origWidth(): number

      获取原始图像宽度。

      Returns number

    • get updateRevision(): number

      Monotonic content version used by each rendering backend for independent synchronisation.

      Returns number

    • get useMipmap(): boolean

      是否使用 mipmap

      Returns boolean

    • Snapshot content changes newer than a backend-local revision without consuming them. Backends advance their own revision only after every upload in the snapshot succeeds. If the requested revision predates the bounded incremental journal, requiresFullUpload is true and the retained checkpoint is the authoritative baseline.

      Parameters

      • revision: number

      Returns TextureUpdateSnapshot

    • Update one texture region. The descriptor is immutable after the call returns. Cube, 2D-array, and 3D destinations select their subresource with face, layer, or z. Non-base levels require an explicit mipmap chain. Compressed writes use exact raw block data.

      Parameters

      • descriptor: TextureSubImage

        Complete mip/subresource/destination/source description.

      Returns void

      texture.updateSubTexture({
      mipLevel: 0,
      x: 16,
      y: 8,
      width: 4,
      height: 4,
      image: pixels
      });