diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/UpdatedTerrainPatch.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/UpdatedTerrainPatch.java index f6d370b23..697e81b2d 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/UpdatedTerrainPatch.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/UpdatedTerrainPatch.java @@ -33,6 +33,7 @@ package com.jme3.terrain.geomipmap; import com.jme3.scene.VertexBuffer.Type; import java.nio.Buffer; +import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.nio.ShortBuffer; @@ -180,6 +181,8 @@ public class UpdatedTerrainPatch { updatedPatch.getMesh().setBuffer(Type.Index, 3, (IntBuffer)newIndexBuffer); else if (newIndexBuffer instanceof ShortBuffer) updatedPatch.getMesh().setBuffer(Type.Index, 3, (ShortBuffer)newIndexBuffer); + else + updatedPatch.getMesh().setBuffer(Type.Index, 3, (ByteBuffer)newIndexBuffer); } } diff --git a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/util/EntropyComputeUtil.java b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/util/EntropyComputeUtil.java index 0f638830e..a33921e8c 100644 --- a/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/util/EntropyComputeUtil.java +++ b/jme3-terrain/src/main/java/com/jme3/terrain/geomipmap/lodcalc/util/EntropyComputeUtil.java @@ -41,6 +41,7 @@ import com.jme3.scene.VertexBuffer; import com.jme3.scene.VertexBuffer.Type; import com.jme3.util.BufferUtils; import java.nio.Buffer; +import java.nio.ByteBuffer; import java.nio.FloatBuffer; import java.nio.IntBuffer; import java.nio.ShortBuffer; @@ -78,6 +79,8 @@ public class EntropyComputeUtil { terrainBlock.setBuffer(Type.Index, 3, (IntBuffer)lodIndices); else if (lodIndices instanceof ShortBuffer) { terrainBlock.setBuffer(Type.Index, 3, (ShortBuffer) lodIndices); + } else { + terrainBlock.setBuffer(Type.Index, 3, (ByteBuffer) lodIndices); } // Recalculate collision mesh