diff --git a/src/config.h b/src/config.h index 97f5ba544..86239d47d 100644 --- a/src/config.h +++ b/src/config.h @@ -322,7 +322,11 @@ #endif #ifndef SUPPORT_GPU_SKINNING // GPU skinning disabled by default, some GPUs do not support more than 8 VBOs - #define SUPPORT_GPU_SKINNING 0 + #if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43) + #define SUPPORT_GPU_SKINNING 1 + #else + #define SUPPORT_GPU_SKINNING 0 + #endif #endif //------------------------------------------------------------------------------------ diff --git a/src/rmodels.c b/src/rmodels.c index eeebc3d2b..e10f888f8 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -2487,9 +2487,12 @@ static void UpdateModelAnimationVertexBuffers(Model model) float boneWeight = 0.0f; bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated +#if defined (SUPPORT_GPU_SKINNING) + Material material = model.materials[model.meshMaterial[m]]; // Skip if missing bone data or missing anim buffers initialization - if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || + if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) || (mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue; +#endif for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3) {