Skip to content

Commit 3640628

Browse files
authored
SkinningControl: add MAX_BONES_HW_SKINNING_SUPPORT
1 parent c869d8e commit 3640628

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jme3-core/src/main/java/com/jme3/anim/SkinningControl.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ public class SkinningControl extends AbstractControl implements JmeCloneable {
8080

8181
private static final Logger logger = Logger.getLogger(SkinningControl.class.getName());
8282

83+
/**
84+
* The maximum number of bones supported for hardware skinning in common shaders.
85+
*/
86+
private static final int MAX_BONES_HW_SKINNING_SUPPORT = 255;
87+
8388
/**
8489
* The armature of the model.
8590
*/
@@ -190,7 +195,7 @@ private void enableSoftwareSkinning() {
190195
*/
191196
private boolean testHardwareSupported(RenderManager renderManager) {
192197
// Only 255 bones max supported with hardware skinning in common shaders.
193-
if (armature.getJointCount() > 255) {
198+
if (armature.getJointCount() > MAX_BONES_HW_SKINNING_SUPPORT) {
194199
logger.log(Level.INFO, "Hardware skinning not supported for {0}: Too many bones ({1} > 255).",
195200
new Object[]{spatial, armature.getJointCount()});
196201
return false;

0 commit comments

Comments
 (0)