private boolean testHardwareSupported(RenderManager rm) { //Only 255 bones max supported with hardware skinning if (armature.getJointCount() > 255) { return false; } switchToHardware(); try { rm.preloadScene(spatial); return true; } catch (RendererException e) { logger.log(Level.WARNING, "Could not enable HW skinning due to shader compile error:", e); return false; } }
private void switchToHardware() { numberOfJointsParam.setEnabled(true); jointMatricesParam.setEnabled(true); // Next full 10 bones (e.g. 30 on 24 bones) int numBones = ((armature.getJointCount() / 10) + 1) * 10; numberOfJointsParam.setValue(numBones); for (Geometry geometry : targets) { Mesh mesh = geometry.getMesh(); if (mesh != null && mesh.isAnimated()) { mesh.prepareForAnim(false); } } }