we
    Preparing search index...

    Interface IV_OptionVideoTexture

    纹理与材质可以公用的的初始化参数

    premultipliedAlpha:是否预乘alpha,默认为true,只有在有透明的情况下有效。

    upsideDownY:是否上下翻转Y轴,默认为true

    format:纹理的格式,默认为rgba8unorm-srgb

    usage:纹理的使用方式,默认为TEXTURE_BINDING | COPY_SRC | COPY_DST | RENDER_ATTACHMENT

    interface IV_OptionVideoTexture {
        controls?: boolean;
        dynamicExternal?: boolean;
        format?: GPUTextureFormat;
        loop?: boolean;
        mipmap?: I_mipmap;
        model?: T_modelOfVideo;
        muted?: boolean;
        name?: string;
        premultipliedAlpha?: boolean;
        sampler?: GPUFilterMode | GPUSamplerDescriptor;
        samplerBindingType?: GPUSamplerBindingType;
        source: T_VIdeoSourceType;
        update?: (scope: any) => any;
        updateAtEnd?: (scope: any) => any;
        upsideDownY?: boolean;
        usage?: number;
        waitFor?: "canplaythrough" | "loadedmetadata";
    }

    Hierarchy (View Summary)

    Index

    Properties

    controls?: boolean
    dynamicExternal?: boolean

    External采用何种模式实现 1、true: 动态纹理模式,DC是动态的,bindingGruop会每帧重新创建 2、false: 动态--静态纹理模式,建立一个内部的GPUTexture,在update()时,将动态纹理copy到其中。DC是静态的,bindingGruop不会每帧重新创建 3、默认:true,推荐

    format?: GPUTextureFormat

    纹理的格式,默认=rgba8unorm

    loop?: boolean
    mipmap?: I_mipmap

    mipmap:是否生成mipmap

    muted?: boolean
    name?: string
    premultipliedAlpha?: boolean

    纹理的premultipliedAlpha,默认:false(只有color类纹理才需要预乘,数据类纹理不需要预乘) 1、如果为true,copyExternalImageToTexture()时,预乘alpha。 2、如果为false,copyExternalImageToTexture()时,不预乘alpha。

    何时使用: 1、用标准透明混合(Blending)的纹理。 标准混合方程:src × 1 + dst × (1−srcA):要求 src 是预乘的,否则混合结果错误。 非预乘混合方程:src × srcA + dst × (1−srcA):要求 src 是非预乘的,否则混合结果错误。(如果这时预乘,则变暗,相当于2次乘法了) 2、过滤 / 插值更正确(抗锯齿、mipmap) 预乘:RGB 与 A 同步缩放,过滤 / 插值结果自然正确,无异常色边。 非预乘:透明边缘插值会出现灰边、黑边(RGB 与 A 插值不同步) 3、透明度叠加更自然 多层透明叠加时,预乘能保证: 半透明物体亮度衰减线性合理 避免 “透明越叠越暗” 何时不用: 1、不透明纹理 2、alphaTest

    sampler?: GPUFilterMode | GPUSamplerDescriptor

    采样器有两种采样器设置方式 1、简单设置采样器模式( "linear" | "nearest");采样器过滤模式,默认为linear 2、采用完整的GPUSamplerDescriptor设置

    samplerBindingType?: GPUSamplerBindingType

    采样器绑定类型,默认是filtering ("comparison" | "filtering" | "non-filtering") 如果指定了samplerDescriptor,则必须指定samplerBindingType

    纹理的源数据,由后续的基础类再次定义使用

    update?: (scope: any) => any

    自定义更新functon()

    updateAtEnd?: (scope: any) => any

    在最后执行调用

    upsideDownY?: boolean

    是否上下翻转Y轴 默认=true;

    usage?: number

    纹理的使用方式:使用GPUTextureUsage 默认为:GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_SRC | GPUTextureUsage.COPY_DST

    waitFor?: "canplaythrough" | "loadedmetadata"

    视频加载等待时间,默认canplaythrough 1、canplaythrough: 视频加载到可以播放的级别 2、loadedmetadata: 视频加载到元数据级别 3、默认:canplaythrough