// #typescript options?.IsNotIfcProductFlag()


precision highp float;

attribute vec3 position;
attribute vec2 uv;
uniform vec3 size;
uniform mat4 worldViewProjection;
uniform mat4 worldMatrix;
out vec3 vPositionW;
out float vColorPixelIndex;

void main(void) {
    gl_Position = worldViewProjection * vec4(position, 1.0);

    vPositionW = (worldMatrix * vec4(position, 1.0)).xyz;

    // uv.x is colorPixelIndex which represents 
    // * pixel offset in IFC object color texture (diffuseSampler). We calculate real UV coordinates from this
    // * gpu pickingcolor (RGB). We use this as fragment color to ge unique color representing the object this vertex belongs to.
    //   do note that we only use 24 bits of uv.x for color (alpha is not used). Hence we have a maximum of 2^24 unique colors.

    vColorPixelIndex = uv.x;
}