diff --git a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java index 3ce7f5210..47165f687 100644 --- a/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java +++ b/engine/src/core-plugins/com/jme3/scene/plugins/OBJLoader.java @@ -454,9 +454,11 @@ public final class OBJLoader implements AssetLoader { if (hasNormals){ normBuf = BufferUtils.createFloatBuffer(vertIndexMap.size() * 3); + m.setBuffer(VertexBuffer.Type.Normal, 3, normBuf); } if (hasTexCoord){ tcBuf = BufferUtils.createFloatBuffer(vertIndexMap.size() * 2); + m.setBuffer(VertexBuffer.Type.TexCoord, 2, tcBuf); } IndexBuffer indexBuf = null; @@ -517,9 +519,7 @@ public final class OBJLoader implements AssetLoader { } m.setBuffer(VertexBuffer.Type.Position, 3, posBuf); - m.setBuffer(VertexBuffer.Type.Normal, 3, normBuf); - m.setBuffer(VertexBuffer.Type.TexCoord, 2, tcBuf); - // index buffer was set on creation + // index buffer and others were set on creation m.setStatic(); m.updateBound();