we
    Preparing search index...

    mesh的顶点结构与材质,各有一个,一一对应

    interface IV_PointsEntity {
        attributes: {
            data: {
                indices?: number[];
                vertexStepMode?: GPUVertexStepMode[];
                vertices: { [name: string]: number[] };
            };
        };
        color?: weVec4
        | weVec3;
        cullMode?: GPUCullMode;
        drawMode?: I_drawModeIndexed | I_drawMode;
        dynamicAttribute?: boolean;
        emulate?: T_PointEmulate;
        instance?: I_entityInstance;
        invertNormal?: boolean;
        material?: BaseMaterial;
        matrix?: weMat4;
        name?: string;
        position?: weVec3;
        primitive?: GPUPrimitiveState;
        quaternion?: weVec4;
        relation?: T_worldRelationTransmit;
        rotate?: weVec4;
        scale?: weVec3;
        shaderCode?: string;
        shaderCodeFunction?: string;
        shadow?: I_optionShadowEntity;
        size?: number;
        update?: (scope: any) => any;
        updateAtEnd?: (scope: any) => any;
    }

    Hierarchy (View Summary)

    Index

    Properties

    attributes: {
        data: {
            indices?: number[];
            vertexStepMode?: GPUVertexStepMode[];
            vertices: { [name: string]: number[] };
        };
    }

    顶点属性 和几何体二选一

    Type Declaration

    • data: {
          indices?: number[];
          vertexStepMode?: GPUVertexStepMode[];
          vertices: { [name: string]: number[] };
      }

      顶点数据

    color?: weVec4 | weVec3

    1、颜色,与material互斥 2、顶点着色,需要使用VertexMaterial材质

    cullMode?: GPUCullMode

    剔除面 : "front" | "back" | "all"

    绘制方式

    dynamicAttribute?: boolean

    是否动态attribute数据 1、默认false。涉及BOL和底层的CPU到GPU数据的传输,如果需要动态更新attribute数据,则需要设置为true。else 2、动态顶点属性的: A、数据的内容在运行时有动态变化; B、数据的长度在运行时有动态变化; 3、drawMode 不可以变化:索引模式或非索引模式 4、属性数据和索引数据只支持 number[] 类型 A、DCG中不适用pointer,而是使用单独GPUBuffer。 B、后续使用setVertexBuffer() 和setIndexBuffer()来重新绑定顶点数据和索引数据。

    emulate?: T_PointEmulate

    模拟的形状

    instance?: I_entityInstance

    内部实例化参数,默认为只有当前entity,无其实例化

    invertNormal?: boolean

    是否反转法线,默认false

    material?: BaseMaterial

    1、材质, 与颜色互斥 2、默认是没有材质,只有在emulate有值的时候才会有材质

    matrix?: weMat4
    name?: string
    position?: weVec3
    primitive?: GPUPrimitiveState

    图元状态

    quaternion?: weVec4
    rotate?: weVec4
    scale?: weVec3
    shaderCode?: string

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

    shaderCodeFunction?: string

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

    阴影选项

    size?: number

    1、默认是,webGPU的一个像素(没有emulate的情况) 2、模拟的形状需要尺寸,float

    update?: (scope: any) => any

    自定义更新functon()

    updateAtEnd?: (scope: any) => any

    在最后执行调用