Now I have a mesh only contains point, no triangles. I’m working on point could LOD.
public void bakeLods(Mesh mesh, float... reductionValues) {
int lodCount = reductionValues.length;
VertexBuffer[] lods = new VertexBuffer[lodCount + 1];
int numBakedLods = 1;
lods[0] = mesh.getBuffer(VertexBuffer.Type.Index);
// TODO
mesh.setLodLevels(lods);
}
nehon
May 26, 2016, 5:41am
2
LOD as it’s implemented in jme won’t work if you have no triangle.
You will need several meshes and switch them with the distance.
And how to switch geometry’s mesh by setMesh?
I tried, but not work.
@Override
public void setLodLevel(int lodLevel) {
if (lodMeshs.length > lodLevel && lodMeshs[lodLevel] != getMesh() && lodMeshs[lodLevel] != null) {
System.out.println("PTSGeometry.setLodLevel()..." + lodLevel);
setMesh(lodMeshs[lodLevel]);
updateModelBound();
updateGeometricState();
}
}
nehon
May 26, 2016, 5:47am
4
ha I answered in your other thread
I can switch mesh now. But multi have repeat point data. So the memory takes up a lot of.
I think I should use Vertex Index to reduct mesh.
Can you provide any help?
nehon
May 26, 2016, 3:21pm
6
Indices are what indicates opengl how to draw faces between vertices… If you don’t have faces you don’t need Indices. And you can’t use them for lod.