we
    Preparing search index...

    视频材质的初始化参数 *

    interface IV_VideoMaterial {
        acceptLight?: boolean;
        acceptShadow?: boolean;
        alphaTransparent?: I_AlphaTransparentOfMaterial;
        clip?: {
            disanceOfplaneX?: number;
            disanceOfplaneY?: number;
            disanceOfplaneZ?: number;
            kind:
                | "planeX"
                | "planeY"
                | "planeZ"
                | "planyXY"
                | "planeYZ"
                | "planeXZ"
                | "planeXYZ"
                | "planeOne"
                | "SDF";
            planeOneFN?: weVec4;
            SDF?: {
                invertModelMatrix?: number[];
                kind?: number;
                parameter?: weVec4;
                round?: boolean;
                roundRadius?: number;
            };
        };
        depthBias?: { bias?: number; scale?: number };
        doubleSided?: boolean;
        name?: string;
        samplerBindingType?: GPUSamplerBindingType;
        samplerDescriptor?: GPUSamplerDescriptor;
        samplerFilter?: GPUFilterMode;
        shaderCode?: string;
        shaderCodeFunction?: string;
        shadowMapBias?: number;
        textures: { video: T_VIdeoSourceType | VideoTexture };
        transparentMode?: T_transparentMode;
        update?: (scope: any) => any;
        updateAtEnd?: (scope: any) => any;
        uv?: {
            offset?: number[];
            rotate?: number;
            scale?: number[];
            uv_index?: number;
        };
        videoOption?: {
            controls?: boolean;
            loop?: boolean;
            model?: T_modelOfVideo;
            muted?: boolean;
            waitFor?: "canplaythrough"
            | "loadedmetadata";
        };
    }

    Hierarchy (View Summary)

    Index

    Properties

    acceptLight?: boolean

    是否接受光照,默认true

    acceptShadow?: boolean

    是否接受阴影,默认true

    alphaTransparent?: I_AlphaTransparentOfMaterial

    alpha透明材质参数

    clip?: {
        disanceOfplaneX?: number;
        disanceOfplaneY?: number;
        disanceOfplaneZ?: number;
        kind:
            | "planeX"
            | "planeY"
            | "planeZ"
            | "planyXY"
            | "planeYZ"
            | "planeXZ"
            | "planeXYZ"
            | "planeOne"
            | "SDF";
        planeOneFN?: weVec4;
        SDF?: {
            invertModelMatrix?: number[];
            kind?: number;
            parameter?: weVec4;
            round?: boolean;
            roundRadius?: number;
        };
    }

    Type Declaration

    • OptionaldisanceOfplaneX?: number
    • OptionaldisanceOfplaneY?: number
    • OptionaldisanceOfplaneZ?: number
    • kind:
          | "planeX"
          | "planeY"
          | "planeZ"
          | "planyXY"
          | "planeYZ"
          | "planeXZ"
          | "planeXYZ"
          | "planeOne"
          | "SDF"
    • OptionalplaneOneFN?: weVec4

      xyz=平面One的法线向量,w=距离

    • OptionalSDF?: {
          invertModelMatrix?: number[];
          kind?: number;
          parameter?: weVec4;
          round?: boolean;
          roundRadius?: number;
      }
    depthBias?: { bias?: number; scale?: number }

    材质深度偏移量,默认:不使用

    doubleSided?: boolean

    是否双面渲染,默认false 1、WE中有两处可以涉及渲染的剔除 A、本处设置,只会涉及是否是双面 B、entity的primitive的参数; 2、执行判断顺序 VS设置->材质的doubleSided 3、优先级与覆盖 材质doubleSided高于entity的primitive设置,如果有材质的doubleSided参数,会覆盖entity的primitive的参数。

    name?: string
    samplerBindingType?: GPUSamplerBindingType

    采样器绑定类型,默认是filtering 如果指定了samplerDescriptor,则必须指定samplerBindingType

    samplerDescriptor?: GPUSamplerDescriptor

    采样器。 1、若有此参数,忽略samplerFilter的参数 2、在material中设置,会覆盖此类设置。

    samplerFilter?: GPUFilterMode

    1、简单设置采样器模式,如果有samplerDescriptor设置 ,则忽略此设置 2、采样器过滤模式,默认为linear 3、在material中设置,会覆盖此类设置。

    shaderCode?: string

    自定义shader主代码,包括VS和FS

    shaderCodeFunction?: string

    自定义shader 函数代码,包括VS和FS

    shadowMapBias?: number

    阴影贴图偏移量,默认:安装系统默认值(0.08) todo:20260517 未设计与实现。目前在fn_pcss.wgsl中是固定的0.08。

    textures: { video: T_VIdeoSourceType | VideoTexture }
    transparentMode?: T_transparentMode

    透明模式 ,默认opaque

    update?: (scope: any) => any

    自定义更新functon()

    updateAtEnd?: (scope: any) => any

    在最后执行调用

    uv?: { offset?: number[]; rotate?: number; scale?: number[]; uv_index?: number }

    uv偏移量,材质的全局参数。 若具体PBR的参数有单独uv参数,优先使用单独的uv参数。

    videoOption?: {
        controls?: boolean;
        loop?: boolean;
        model?: T_modelOfVideo;
        muted?: boolean;
        waitFor?: "canplaythrough" | "loadedmetadata";
    }