My custom terrain looks wrong from blender generated heightmap

How it looks in Blender: http://i.imgur.com/Rfc6C.jpg

How it looks in my game: http://i.imgur.com/b2lO7.jpg



The heightmap I generated: http://i.imgur.com/cNqnv.png

I followed http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Landscape_Modeling_III:_Exporting_as_a_Heightmap



As you see the scales are just wrong. Compare the height of the mountain to the other parts of the terrain. My code for the heightmap is copied from HelloTerrain without using setLocalScale.

Well you have a usual problam when using heighmaps,



What heigh is white?

What is black?



There is no standart for this defined, I assume that someway it can b made compatible, but I have not enough knowledge of this to help you more than this basics. I suggestfiddle a bit with different settings untill it fits, or someone with a better idea replies XD

I assumed it was linear.

Yes,probably but between wich heigh values? Thats the problem, white and black cannot say i’m 500m :slight_smile:

So… How do I fix it? Is the problem in my Blender export or the jME import?

@sbook maybe you know this

Whats the issue? This looks fine to me, the “bottom walls” seem to be so high because they go all the way down to the terrain “0” point.

something is with interpolation from 0 to 1… It seems interpolation are different in jme and blender.



two solutions could be, possibly:

1 fit blender Displace modifier to JME interpolation.

Have a look at settings if the Displace modifier in blender. Try different tweaks.



2 Change JME interpolation in the Terrain shader.

have a look at vertex/fragment shader in the Terrain shader which you use.

If you do 2 the physics need to be adjusted as well.

so, the only way is to tweak blender’s settings.

or don’t use blender for terrain creation.

@WASD the problem is with your blender export. A diagram will help me explain …



http://i.imgur.com/pQinj.png



look at 1, it shows the approx height % for those 3 levels, if you measure the colours from your generated height map, the middle level is wrong, it should be 30% gray (much darker).



You can probably fix this in Photoshop or Gimp by adjusting the Levels … (3) the middle slider will probably be most useful in this case, however the end ones can be equaly as useful.

1 Like

Thanks @thetoucher and everyone else. I’ll try your solutions and reply here how it worked out later today.

remember that Terrain system have a smooth parameter too, so if you set it too high, it can look dffrent, but its not issue here.

Thanks all :slight_smile: I messed with the levels in blender and it’s much better now. Can’t get it to be exactly as I designed it but it’s close enough.

@thetoucher said:look at 1, it shows the approx height % for those 3 levels, if you measure the colours from your generated height map, the middle level is wrong, it should be 30% gray (much darker).

You can probably fix this in Photoshop or Gimp by adjusting the Levels ... (3) the middle slider will probably be most useful in this case, however the end ones can be equaly as useful.


This.

Any reason you aren't using the terrain editor in the SDK? It would probably be a much more straightforward process..
@sbook said:
Any reason you aren't using the terrain editor in the SDK? It would probably be a much more straightforward process..

I tried it but blender has much more advanced tools. Also the max-size of the brush was not big enough.

Good feedback, I will make the brush max-size bigger.

1 Like
@oxplay2 said:
remember that Terrain system have a smooth parameter too, so if you set it too high, it can look dffrent, but its not issue here.


Hey there. What parameter is that?

It is part of heightmap. TerrainTest.java has an example