Terrain updateFromHeightMap() issue

Hi all, while trying to work with the terrain, I have had an issue when updateFromHeightMap, the issue appears, when you serialize your terrain, then try to recreate it from the serialized file. I just used the plain creation from the height maps, when I load it, it just appears fine, but when try to invoke updateFromHeightMap, I got something like this image:









Again it only happends when you serialize the terrainpage/terrainblock mesh.



Thanks in advance.

So after a quick scan, the big difference I see is that I'm extending TriMesh instead of AreaClodMesh.  So it seems like the onus is back on the clods.

That is really cool looking! 8)

the index buffers look broken to me (speculating - at work, can't test - sorry). i suppose the object ins the screenshot is a terrain page. the terrain blocks are placed correctly, only the triangles are messed up (they don't look like anything how they should look like). again, just speculating: could it be that you save clod meshes?



sorry for not being really helpful :stuck_out_tongue:

Maybe you could just change your game concept into something where a giant piece of aluminum foil is slowly comsuming the earth and your character must find a way to destroy it?

chirstius said:

Maybe you could just change your game concept into something where a giant piece of aluminum foil is slowly comsuming the earth and your character must find a way to destroy it?


XD

XD

Looks almost like a clod issue…  Can you use binaryimport/export instead of serializing?

i suppose the object ins the screenshot is a terrain page. the terrain blocks are placed correctly, only the triangles are messed up

Exactly. The terrain blocks extends the clodmesh, so it might be the reson. I don't know.

Can you use binaryimport/export instead of serializing?


renanse, thats what I have used. Binary import/export to serialize the terrian page, nothing extra from me, I just used the facilities you provided, first I created a terrain page, then saved it to a file with the exporter, then I loadeded it for editing.
renanse said:

Looks almost like a clod issue...
Can you use binaryimport/export instead of serializing?


renanse, thats what I have used. Binary import/export to serialize the terrian page, nothing extra from me, I just used the facilities you provided, first I created a terrain page, then saved it to a file with the exporter, then I loadeded it for editing.


Ah, sounded like you were using Java serializing.  We use the binary tools at work and I have not seen any such issues, but we've written a separate terrain block for z-up terrain.  I'll have a look to see if there is something special about our z-up terrain block code.

I've no issue with changing terrain to not extend clod.  What do the other devs think?

HI renanse,



I have tried to do the same, I made the TerrainBlock extends TriMesh, instead of AreaClodMesh, and its working fine now, so the prob is from clods.  But I can't keep it that way, I don't want to chang anything from jMe side.



I noticed also that the creation time of the terrain has shrinked a little bit.



Thanks.

i'm not sure if clod mesh terrains are useful at all anyways :confused:

sfera said:

i'm not sure if clod mesh terrains are useful at all anyways :/


Definitely not, LOD is only worth it if you have a huge, very detailed terrain. Then you can use stuff like geometry clipmaps etc, more advanced mechanism but CLOD is definitely way to CPU hungry for terrain.

i know, i tried it all already :slight_smile:

i didn't look into this yet, but one thing to keep in mind is that the binary saved terrain files (jme) should not become useless because of such a change.