private int getRemainingBuffers(Mesh mesh, Renderer renderer) {
        int nbUsedBuffers = 0;
        for (VertexBuffer vb : mesh.getBufferList().getArray()) {
            boolean isMorphBuffer = vb.getBufferType().ordinal() >= VertexBuffer.Type.MorphTarget0.ordinal() && vb.getBufferType().ordinal() <= VertexBuffer.Type.MorphTarget9.ordinal();
            if (vb.getBufferType() == VertexBuffer.Type.Index || isMorphBuffer) continue;
            if (vb.getUsage() != VertexBuffer.Usage.CpuOnly) {
                nbUsedBuffers++;
            }
        }
        return renderer.getLimits().get(Limits.VertexAttributes) - nbUsedBuffers;
    }
Computes the number of remaining buffers on this mesh.
This is supposed to give a hint on how many attributes will be used in the material and computes the remaining available slots for the morph attributes.
However, the shader can declare attributes that are not used and not bound to a real buffer.
That's why we attempt to compile the shader later on to avoid any compilation crash.
This method is here to avoid too much render test iteration.

@param mesh
@param renderer
@return
jme3-core/src/main/java/com/jme3/anim/MorphControl.java