API

Function cloneTexture2D

  • Create a fresh Texture2D wrapper that shares GPU resources with base but carries its own UV transform. Use this when the same underlying image is referenced with different transforms (e.g. glTF KHR_texture_transform on different textureInfos pointing at the same source). The caller is responsible for acquireTexture/release pairing if the wrapper outlives the base. RTT-derived clones follow replacement attachment generations; ordinary clones snapshot the GPU fields.

    Parameters

    • base: Texture2D
    • transform: Partial<Pick<Texture2D, "uScale" | "vScale" | "uOffset" | "vOffset" | "uAng">> & {
          _hasTx?: true;
          _texCoord?: 0 | 1;
      }

    Returns Texture2D