declare const _default: "\n\nattribute vec4 vertex_boneWeights;\nattribute vec4 vertex_boneIndices;\n\nuniform highp sampler2D texture_poseMap;\n\nvoid getBoneMatrix(const in int width, const in int index, out vec4 v1, out vec4 v2, out vec4 v3) {\n\n    int v = index / width;\n    int u = index % width;\n\n    v1 = texelFetch(texture_poseMap, ivec2(u + 0, v), 0);\n    v2 = texelFetch(texture_poseMap, ivec2(u + 1, v), 0);\n    v3 = texelFetch(texture_poseMap, ivec2(u + 2, v), 0);\n}\n\nmat4 getSkinMatrix(const in vec4 indicesFloat, const in vec4 weights) {\n\n    int width = textureSize(texture_poseMap, 0).x;\n    ivec4 indices = ivec4(indicesFloat + 0.5) * 3;\n\n    // get 4 bone matrices\n    vec4 a1, a2, a3;\n    getBoneMatrix(width, indices.x, a1, a2, a3);\n\n    vec4 b1, b2, b3;\n    getBoneMatrix(width, indices.y, b1, b2, b3);\n\n    vec4 c1, c2, c3;\n    getBoneMatrix(width, indices.z, c1, c2, c3);\n\n    vec4 d1, d2, d3;\n    getBoneMatrix(width, indices.w, d1, d2, d3);\n\n    // multiply them by weights and add up to get final 4x3 matrix\n    vec4 v1 = a1 * weights.x + b1 * weights.y + c1 * weights.z + d1 * weights.w;\n    vec4 v2 = a2 * weights.x + b2 * weights.y + c2 * weights.z + d2 * weights.w;\n    vec4 v3 = a3 * weights.x + b3 * weights.y + c3 * weights.z + d3 * weights.w;\n\n    // add up weights\n    float one = dot(weights, vec4(1.0));\n\n    // transpose to 4x4 matrix\n    return mat4(\n        v1.x, v2.x, v3.x, 0,\n        v1.y, v2.y, v3.y, 0,\n        v1.z, v2.z, v3.z, 0,\n        v1.w, v2.w, v3.w, one\n    );\n}\n";
export default _default;
