diff --git a/binaries/data/mods/public/shaders/glsl/model_common.vs b/binaries/data/mods/public/shaders/glsl/model_common.vs index 1d4a324d22..395080e8f4 100644 --- a/binaries/data/mods/public/shaders/glsl/model_common.vs +++ b/binaries/data/mods/public/shaders/glsl/model_common.vs @@ -1,9 +1,4 @@ -#if USE_GPU_SKINNING -// Skinning requires GLSL 1.30 for ivec4 vertex attributes -#version 130 -#else #version 120 -#endif uniform mat4 transform; uniform vec3 cameraPos; @@ -60,7 +55,7 @@ attribute vec2 a_uv1; const int MAX_INFLUENCES = 4; const int MAX_BONES = 64; uniform mat4 skinBlendMatrices[MAX_BONES]; - attribute ivec4 a_skinJoints; + attribute vec4 a_skinJoints; attribute vec4 a_skinWeights; #endif @@ -78,7 +73,7 @@ void main() vec3 p = vec3(0.0); vec3 n = vec3(0.0); for (int i = 0; i < MAX_INFLUENCES; ++i) { - int joint = a_skinJoints[i]; + int joint = int(a_skinJoints[i]); if (joint != 0xff) { mat4 m = skinBlendMatrices[joint]; p += vec3(m * vec4(a_vertex, 1.0)) * a_skinWeights[i]; diff --git a/source/renderer/InstancingModelRenderer.cpp b/source/renderer/InstancingModelRenderer.cpp index 06e4b670eb..e96c3491d5 100644 --- a/source/renderer/InstancingModelRenderer.cpp +++ b/source/renderer/InstancingModelRenderer.cpp @@ -346,7 +346,7 @@ void InstancingModelRenderer::PrepareModelDef(const CShaderProgramPtr& shader, i // GPU skinning requires extra attributes to compute positions/normals if (m->gpuSkinning) { - shader->VertexAttribIPointer("a_skinJoints", 4, GL_UNSIGNED_BYTE, stride, base + m->imodeldef->m_BlendJoints.offset); + shader->VertexAttribPointer("a_skinJoints", 4, GL_UNSIGNED_BYTE, GL_FALSE, stride, base + m->imodeldef->m_BlendJoints.offset); shader->VertexAttribPointer("a_skinWeights", 4, GL_UNSIGNED_BYTE, GL_TRUE, stride, base + m->imodeldef->m_BlendWeights.offset); }