sampie
April 22, 2012, 1:39pm
1
Hi,
I have created terrain generation functionality (part of a game project I am working with).
Here is something that has been implemented:
Diamond Square height map generator (http://en.wikipedia.org/wiki/Diamond-square_algorithm )
Generating heightmap with: mountains, flat terrain, water. At generation time user can give percentages of how much of mountains,flat terrain and water exists in the terrain.
Generating textures for the terrain according to height map. For example, according height values apply following materials: snow, rock, grass, sand and finally material which is sea floor.
See a screenshot of generated terrain in jme3: http://users.utu.fi/sampie/jme/diamondterrain.png
If this is something that is interesting (?) I can contribute the code for JME3 project.
4 Likes
sampie
April 26, 2012, 2:38pm
2
The code is available at: http://users.utu.fi/sampie/jme/DiamondTerrain.zip
Just drop in jme3 libs and run DiamondTerrain.java. It takes couple seconds to generate the terrain.
zarch
April 26, 2012, 3:14pm
3
How does it compare with the existing JME3 terrain system? What does it offer over and above?
It uses the jme terrain system. it’s a system for generating heightmaps, and also splat-maps that textures the terrain depending on elevation.
nice job.
normen
April 26, 2012, 11:44pm
6
@sampie said:
If this is something that is interesting (?) I can contribute the code for JME3 project.
It could be made a plugin for the SDK to generate terrain with a wizard maybe?
Looks nice Sampie.
A plugin to the sdk would be wonderful. An enhancement too: textures based on slope (ie. no grass on steep slopes).
Setekh
April 27, 2012, 5:49am
8
@Sploreg said:
Looks nice Sampie.
A plugin to the sdk would be wonderful. An enhancement too: textures based on slope (ie. no grass on steep slopes).
thats what i was thinking as well, i really like how he did it with out any shader :P
kwando
April 27, 2012, 6:03am
9
Good work! The automatic splatmap generation is a feature jME3 currently lacks
Is it just elevation or is it slope too?
sampie
April 27, 2012, 11:20am
10
Unfortunately the implementation does not include slope based texturing, only heightmap values are used as a such.
There seems to be a bug in splat texture generator. Fixed package can be found from: http://users.utu.fi/sampie/jme/DiamondTerrain-2.zip
I also tweaked texture fallout values to get a slightly new look for following close-up screenshots.
http://users.utu.fi/sampie/jme/diamondterrain-2.png
http://users.utu.fi/sampie/jme/diamondterrain-3.png
http://users.utu.fi/sampie/jme/diamondterrain-4.png