ivec4 as vertex attribute Opengl ES 2.0
<p>I use openglEs 2.0. I am working on hardware skinning. I try to pass bone indices as ivec4 however compiler tells me that it is impossible to use ivec4 as vertex attribute. How can I overcome this stuation ?</p>

<p>Here is my Vertex shader code.</p>

<pre><code>0(1) : error C7507: OpenGL does not allow attributes of type ivec4
"struct Bone"
    "{"
    "   mat4 transform;"
    "   mat4 bindPose;"
    "};"
    "attribute vec3 vPosition;"
    "attribute vec3 vNormal;"
    "attribute vec2 vTexture;"
    "attribute ivec4 vBones;"
    "attribute vec4 vWeights;"
    "uniform mat4 projectViewModel;"
    "uniform Bone bones[64];"
    "varying vec3 v_normal;"
    "varying vec2 v_texCoord;"
    "void main()"
    "{"
    "   gl_Position = bones[vBones.x].transform * bones[vBones.x].bindPose * vec4(vPosition, 1.0) * vWeights.x;"
    "   gl_Position += bones[vBones.y].transform * bones[vBones.y].bindPose * vec4(vPosition, 1.0) * vWeights.y;"
    "   gl_Position += bones[vBones.z].transform * bones[vBones.z].bindPose * vec4(vPosition, 1.0) * vWeights.z;"
    "   gl_Position += bones[vBones.w].transform * bones[vBones.w].bindPose * vec4(vPosition, 1.0) * vWeights.w;"
    "   gl_Position = projectViewModel * gl_Position;"
    "   v_texCoord = vTexture;"
    "   v_normal = vNormal;"
    "}";
</code></pre>

<p>UPDATE:</p>

<p>As I have been told, I changed shader code and client side code. Here is the client side code :</p>

<pre><code>glEnableVertexAttribArray(3); // Bones
glVertexAttribPointer(3, 4, GL_INT, GL_FALSE, object-&gt;m_mesh-&gt;GetVertexSize(), (const void*)offset);
</code></pre>

<p>And this is how I access to bone indices in the shader code :</p>

<pre><code>gl_Position = bones[int(vBones.x)].transform * bones[int(vBones.x)].bindPose * vec4(vPosition, 1.0) * vWeights.x;
</code></pre>

<p>If I run this code on windows pc. It works just fine, However when I compiled it with emscripten to web browsers. It gives gl error 1282 (Invalid Operation).</p>

<p>If I change to GL_FLOAT this fixes gl error however, all bone indices becomes 0 and I get a none skinned mesh because bone 0 has unit matrixes as bindpose and worldpose matrix.</p>