we
    Preparing search index...

    HDR纹理 1、采用"hdrify"库加载HDR纹理 2、支持的HDR格式: ✅ 32-bit_rle_rgbe(.hdr) ✅ 32-bit_rgbe(.hdr) ✅ OpenEXR(FP16/FP32,RLE/ZIP/PIZ/PXR24 等) ✅ UltraHDR JPEG、Adobe Gain Map JPEG 3、默认RGBA格式

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _id: number

    节点ID node ID

    _isDestroy: boolean = false
    _manager: undefined | ECSManager<RootGPU>
    _name: string

    节点名称 node name

    _readyForGPU: boolean

    节点是否以及GPU准备好 node is ready of GPU

    _state: E_lifeState = E_lifeState.unstart

    纹理是否完成,这个是需要处理的(异步数据的加载后,改为true,或没有异步数据加载,在init()中改为true); constructor中设置为false。 如果更改为为true,在材质不工作

    _upsideDownY: boolean = true

    是否上下翻转Y轴

    bitWidth: number = 16
    blockLength: number = 1

    每个块的宽度

    blocksHigh: number

    每列块数

    blocksWide: number

    每行块数

    bytesPerBlock: number = 1

    每个块字节数

    bytesPerRow: number

    每行字节数

    commands: commmandType[] = []
    depth: number = 1
    device: GPUDevice
    height: number = 1
    inputValues: I_BaseTexture
    lastUpdaeTime: number = 0
    mapList: { key: any; map?: string; type: string }[] = []
    name: string
    needUpdateuserDefine: boolean = false

    是否用户自定义更新函数

    needUpdateuserDefineAtEnd: boolean = false

    是否用户自定义更新函数,在update()函数最后调用

    resourcesGPU: ResourceManagerOfGPU
    sampler: GPUSampler

    指定的纹理的采样器,由I_BaseTexture的sampler参数指定。 默认:没有,使用材质的默认采样器。

    samplerLayout: GPUSamplerBindingLayout = ...
    scene: Scene
    texture: any

    纹理 外部访问对象

    textureFormat: GPUTextureFormat = 'rgba8unorm-srgb'
    textureLayout: GPUTextureBindingLayout = ...

    纹理的绑定布局 dictionary GPUTextureBindingLayout { GPUTextureSampleType sampleType = "float";//"depth" | "float" | "sint" | "uint" | "unfilterable-float" GPUTextureViewDimension viewDimension = "2d"; boolean multisampled = false; };

    type: string

    节点类型 node type

    UUID: string

    节点UUID node UUID

    width: number = 1

    Accessors

    Methods

    • 检查textureFormat的字节数和块长度,返回字节数和块长度 1、按需调用,不在构造函数中调用,因为textureFormat可能是不同的,比如HDRTexture的textureFormat是rgba332float

      Parameters

      • format: GPUTextureFormat

      Returns { blockLength: number; bytesPerBlock: number }

      字节数和块长度

    • 根据纹理格式生成配套采样器布局、纹理绑定布局

      Parameters

      • format: GPUTextureFormat

        WebGPU纹理格式

      Returns {
          samplerLayout: GPUSamplerBindingLayout;
          textureLayout: GPUTextureBindingLayout;
      }

      samplerLayout 采样器布局 + textureLayout 纹理绑定布局(默认viewDimension:"2d"、multisampled:false)

      stencil8 不允许作为采样纹理绑定,直接抛出异常 采样器 type 规则:

      1. 深度格式(depth16unorm/depth32float等) → comparison(阴影比较专用)
      2. uint / sint / unfilterable-float(32位浮点) → non-filtering,仅支持nearest过滤
      3. 普通unorm/snorm/16float/HDR打包/压缩纹理 → filtering,支持线性过滤
    • 初始化纹理。 一、两种调用途径: 1、显示调用(加载模式,或人工显示),在new XXXTexture() 之后,使用 await XXXTexture.init(); 2、隐式调用:经由entity->material->texture。 二、必须显示调用的情况 1、非基础纹理(Texutre,CubeTexture,VideoTexutre)的类型,比如HDR,压缩纹理,目前是只能显示调用的。因为material里面没有分析处理url等数据来源的流程。 2、material加载的是BaseTexture类型的子类,而不是url。

      Parameters

      • Optionalscene: Scene

        场景

      Returns Promise<number>

    • 初始化采样器:20260607 1、明确纹理的layout:this.textureLayout:GPUTextureBindingLayout 2、明确采样器: sampler!: GPUSampler; 3、明确采样器的layout:samplerLayout:GPUSamplerBindingLayout

      Returns Promise<any>

    • 正常更新 1、更新I_Update的自定义function 2、调用updateSelf()更新自身私有属性

      Parameters

      • clock: Clock

        Clock 时钟

      • updateSelftFN: boolean = true

        是否调用自身的updateSelf(),默认=true 此参数可以方便子类重载时,决定调用的updateSelf()的时间顺序或是否调用updateSelft()

      Returns boolean