declare const _default: "\n    // When an object is transparent, we'll change its alpha value,\n    // but we should not assign a fixed value because it may already\n    // has an alpha value that is lower than 1.\n    // So, let's multiply a factor.\n    // const float TRANSPARENT_FACTOR = 0.5;\n    // Object color when isolated.\n    // const vec4 ISOLATE_COLOR = vec4(0.5, 0.5, 0.5, 0.2);\n    const vec4 HIGHLIGHT_COLOR = vec4(0.031, 0.906, 0.867, 0.5); // 0x08e8de\n\n    // Hover: subtle emissive lift on shaded color (after lighting; see blendHoverOverlay).\n    const float HOVER_STRENGTH = 0.09;\n    const vec3 HOVER_EMISSIVE = vec3(0.55, 0.72, 0.95);\n\n    // need to make sure the value is the same as in StateType enum / BimTilesMaterialManager.\n    const int StateType_Hidden = 0;\n    const int StateType_Transparent = 1;\n    const int StateType_Highlighted = 2;\n    const int StateType_Hovered = 3;\n    const float HOVER_FADE_DURATION_MS = 300.0;\n\n    /**\n     * Converts a tileObjectId(tilesetId + userId) to color.\n     */\n    vec4 tileObjectId2Color(int id) {\n        int r = id >> 16 & 0xff;\n        int g = id >> 8 & 0xff;\n        int b = id >> 0 & 0xff;\n        int a = id >> 24 & 0xff;\n        return vec4(float(r) / 255.0, float(g) / 255.0, float(b) / 255.0, float(a) / 255.0);\n    }\n\n    // /**\n    //  * Gets tilesetId and userId from a color.\n    //  * (rgb, a) => (userId, tilesetId)\n    //  */\n    // vec2 color2Id(vec4 color) {\n    //     int userId = (int(color.r) << 16) + (int(color.g) << 8)  + (int(color.b) << 0);\n    //     int tilesetId = (int(color.a) << 24);\n    //     return vec2(userId, tilesetId);\n    // }\n\n    /**\n     * Gets userId by tileObjectId.\n     */\n    int tileObjectId2UserId(int tileObjectId) {\n        return tileObjectId & 0x00ffffff;\n    }\n\n    /**\n     * Gets texture color (which contains hidden/transparent/highlight status) form a userId\n     */\n    vec4 getTextureColorByTileObjectId(sampler2D sampler, float textureWidth, float textureHeight, int tileObjectId) {\n        float userId = float(tileObjectId2UserId(tileObjectId));\n        float indexX = mod(userId, textureWidth);\n        float indexY = floor(userId / textureWidth);\n        vec2 texCoord = vec2(indexX / textureWidth, indexY / textureHeight);\n        return texture2D(sampler, texCoord);\n    }\n\n    /**\n     * Gets the flag(0 or 1) from a number by given StateType.\n     * @param num A uint8 number.\n     */\n    bool getFlagByStateType(int num, int state) {\n        // the bit index is the state itself\n        int bitIdx = state;\n        return (num & (0x1 << bitIdx)) != 0;\n    }\n\n    /**\n     * Flags(Hidden/Transparent/Hovered/Highlighted) are in textureColor.r value.\n     */\n    bool getFlagByColor(vec4 textureColor, int state) {\n        // map a color value from 0-1 to range 0-255\n        int num = int(textureColor.r * 255.0);\n        return getFlagByStateType(num, state);\n    }\n\n    /**\n     * Checks if an object is hidden by transparent cloned mesh.\n     */\n    bool isTransparentHidden(vec4 textureColor) {\n        int num = int(textureColor.b * 255.0);\n        return getFlagByStateType(num, StateType_Hidden);\n    }\n\n    /**\n     * Checks if an object is hidden by the \"color\".\n     */\n    bool isHidden(vec4 textureColor) {\n        return getFlagByColor(textureColor, StateType_Hidden);\n    }\n\n    /**\n     * Checks if an object is transparent by the \"color\".\n     */\n    bool isTransparent(vec4 textureColor) {\n        return getFlagByColor(textureColor, StateType_Transparent);\n    }\n\n    /**\n     * Gets opacity value between 0-1.\n     */\n    lowp float getOpacity(vec4 textureColor) {\n        return textureColor.g;\n    }\n\n    bool isHovered(vec4 textureColor) {\n        return getFlagByColor(textureColor, StateType_Hovered);\n    }\n\n    // bool isIsolated(vec4 textureColor) {\n    //     return textureColor.b > 0.5;\n    // }\n\n    /**\n     * Checks if an object is highlighted by the \"color\".\n     */\n    bool isHighlighted(vec4 textureColor) {\n        return getFlagByColor(textureColor, StateType_Highlighted);\n    }\n\n    /**\n     * Soft hover tint on lit color; hoverFactor is 0..1.\n     */\n    vec3 blendHoverOverlay(vec3 base, float hoverFactor) {\n        float luma = dot(base, vec3(0.2126, 0.7152, 0.0722));\n        float atten = 1.0 - smoothstep(0.72, 1.0, luma);\n        return base + HOVER_EMISSIVE * HOVER_STRENGTH * hoverFactor * atten;\n    }\n\n    // TODO: isHighlighted isOverride isHovered\n";
export default _default;
