How can make terrain cliff!

the Height difference like Steep hill!
how can get the vertical cliff?

This will be different for each use case, depending on how the terrain is being created.

HeightMap terrains are efficient and easy to use, but usually do not support vertical cliffs or caves.

Terrains with cliffs can be created as a Model in a 3d model editor and imported into your scene.

A combination of both heightMap terrain and imported terrain feature models (like cliffs, overhangs, or trenches) can be used, but this may be more complicated to implement.

A MUCH more complex method to achieve many various terrain features (including infinite terrain) would be to create the terrain mesh procedurally, like using a 3d noise function to compute a scalar density field for use with an isosurface meshing technique, such as marching cubes. (…or implementing Constructive Solid Geometry)
NOTE: This method could be considered quite advanced, and would involve multiple processes to compose a finished terrain with proper Texture Coordinates and Normal Vectors. This would not be optimal for a “rapid prototype” or “proof of concept” build.

1 Like

A combination of both heightMap terrain and imported terrain feature models (like cliffs, overhangs, or trenches) can be used, but this may be more complicated to implement.

thats easy to do(you just need scene editor(SDK for example)), so imo good one for new user.

1 Like

You can make sheer cliffs from heightmaps. You can also use blender to generate the heightmap and it will look almost identical to the source when loaded into jme and using jme smoothing methods. Assuming you use dds files for the heightmap, i.e 16 bit. You can import the image and export it from gimp using the gimp dds script. Just search for gimp and dds.

The main drawback is that sheer cliffs stretch textures, probably ways to overcome that, just hadn’t gotten to it myself.

These links will give you insight on how to build the heightmap generator but they are for old versions of blender, however the principles are still the same.

https://archive.blender.org/wiki/index.php/Doc:2.4/Tutorials/Textures/Maps/Creating_a_Heightmap_from_a_Plane/

https://wiki.jmonkeyengine.org/jme3/beginner/hello_terrain.html#what-is-a-heightmap
https://javadoc.jmonkeyengine.org/v3.3.0-beta1/com/jme3/terrain/heightmap/AbstractHeightMap.html#smooth-float-

As others said, models and the SDK also are great options. The best results probably will come from a model though. Heightmaps are limited in quality.

Edit: I haven’t tried this but I bet you can model the entire scene in blender, isolate the cliff parts into a separate layer, use the generator to make the heightmap for everything thats left behind. Then you can just add the cliffs into the game as models. Should match up pretty easily. That way the textured model cliffs would look perfect.

Edit2: Forgot to mention that the size for the model in blender is only a 2x2 plane that you generate the image from and it scales up real easy.

Re: stretched textures

Just enable tri planar mapping. I think the terrain shader supports it.

1 Like

Very nice, thanks, wiki only mentions this under the SDK and I wrote this stuff procedural so never saw it.

Sorry for hijack but may help questioner also.

Note: Scale must be reduced and be a power of 2 when using tri-planar in the shader. Tricky to get just right.

keep in mind that because of the limitations of using only grid vertices, the steepness implemented in this way will be proportional to the height difference as the cliff face will always be as wide as 1 grid cell.

I learned this the hard way when I used to play Wurm and tried making walls out of terrain. The dirt had to be over 100 units higher to not appear as a ramping slope. Diagonals also dont match symmetrically from one side to the other, depending on how you triangulate your grid and which direction the diagonals lie.

Yes, this is just for learning to see how heightmaps performed. They have their place but for some things they just don’t work.

who know MarchingCubes and demo?

Not marching cubes, but an isosurface.

1 Like