Jump to content

How to Smooth heightmaps?


Recommended Posts

I'm having trouble creating heightmaps which result in smooth terrain.

My procedure has been the following:

- generate terrain with geomorph

- edit special features and smooth with GIMP

- some more special features + effects with geomorph

- import as rgb-file and convert to raw with terragen

This always results in maps which are more or less close to what I had in mind, but you won't be able to drive your shrike at full speed without flipping over.

I want my map to be as smooth as Dark_au's Thracian Valley, but my maps are not even close to that one in smoothness.

I'm using <ElevationScale> 0.006, that can't be too high as Dark_au is using a higher value in his scenario.

Is <VertexSpacing> relevant?

I'm not using dark_au's heighmap generator, as I want to add my own features and run some filters after generating the base terrain.

Does anyone know a better programme to convert to raw?

[ July 06, 2006, 08:34 AM: Message edited by: tankibanki ]

Link to comment
Share on other sites

You're running into a common problem of resolution, Tanki. Geomorph falls into the category of heightfield editors which use grayscale images as their method of storing elevations. Every pixel in the image has a grayscale value ranging from 0 to 255. This means across your entire terrain, every point is at 1 of 256 possible different elevations. If you think about it, 256 different elevations is not that many to choose from. The height can be said to be at a low resolution.

Contrast this with tools like Leveller or other "high end" heightfield editors where the elevation at each point is stored as a float (as a real number). So each point can be at ANY elevation (e.g. 2.257 meters or 1,039,271.57 meters, etc.)

The fact that your grayscale image only gives you 256 elevation values is why you're getting the "stairstep" effect on your terrain. This is a real shame in the case of Geomorph because it's a very cool heightfield editor.

To "fix" the problem, you need to take your current grayscale data into a higher resolution format and then do a smoothing operation at that higher resolution and then save the result. This will lead to the loss of some detail but there are smart filters that can try to avoid this. If you want to email me your .raw file I will give it a shot with some of the tools we have here and send it back to along with some notes about how we did it.

Link to comment
Share on other sites

Thanks for the help. That explains it, then. I don't want you to waste your time, trying to get my heightmap to look good. I'm sure I'll find a way to achieve good results somehow.

However I'm not going to spend 150$ on a heightmap editor. Are there any programmes which can produce higher resolution data?

I know there won't be any with the same functionality as Leveller, but maybe there's some tool which could convert my greyscale images into smooth heightmaps?

Link to comment
Share on other sites

There's some good news. The authors of geomorph understand the resolution problem described above so they output their heightfields with 16-bit .png images. That means you have the full range of 65,536 elevations in their output file (instead of 256). However, as soon as you open it with GIMP or any other "vanilla" image editor you're going to lose all of that extra data and go back down to 8-bit shades of gray.

It sounds like cinepaint can edit 16-bit png images without losing any data. Have you tried that instead of GIMP? You will still need a tool for the last step of converting from a 16-bit .png image to a .raw file but that's really trivial. Since that would be useful for the community either Stan or I could code up such a tool in an hour or so and post it here.

Link to comment
Share on other sites

Originally posted by ClaytoniousRex:

There's some good news. The authors of geomorph understand the resolution problem described above so they output their heightfields with 16-bit .png images.

(snip)

It sounds like cinepaint can edit 16-bit png images without losing any data. Have you tried that instead of GIMP?

I've used Cinepaint (version 0.21 pre) to edit height maps as part of my ongoing map experiments. It does work and will maintain the 16bit PNGs correctly.

I strongly suspect (but I don't have the right incantation here) that a program like ImageMagick can export a raw 16bit Little endian file when given a 16bit grayscale PNG file.

If you are having grief with Geomorph or Cinepaint, I may be able to help. You can email me at thaynes <AT> sympatico.ca if you wish (that goes for any DropTeam player).

Cheers,

Toby Haynes

Link to comment
Share on other sites

I've got both Windows and Linux on two different computers, both accessing the same directory, so I don't care which platform is needed for which programme.

I know that Quickfrac creates nice maps and has got a smoothing feature. However it doesn't have an import feature. I would immediately use your prog, if it did.

I will try Cinepaint.

Thanks everyone for your help. I'll report on my progress as soon as there is any.

Link to comment
Share on other sites

I tried cinepaint and it works fine, even though I lost some detail while smoothing. I'll have to find out how to use the filters effectively.

It looks as if geomorph really creates 16bit files, so in the future I will probably just do the final editing with geomorph, then use cinepaint to convert to SGI, then terragen to convert to RAW.

Link to comment
Share on other sites

I'd like to be able to import 1 common graphics format. TGA or PNG would be fine. Preferably a format that doesn't lose too much detail (you're the expert).

One more thing: would it be hard to implement a feature to open and modify existing RAW files?

[ July 08, 2006, 01:18 AM: Message edited by: tankibanki ]

Link to comment
Share on other sites

Editing Raw files is easy.. PNG i have no idea of the format. TGA is possible. I thought you were meaning data types not picture types. Data is easier than image based stuff, the problem with that is the co-relation between height and colour usually doesn't give an easily linear scale.

Link to comment
Share on other sites

Originally posted by Dark_au:

Editing Raw files is easy. PNG i have no idea of the format. TGA is possible. I thought you were meaning data types not picture types. Data is easier than image based stuff, the problem with that is the co-relation between height and colour usually doesn't give an easily linear scale.

I was hoping it'd be as easy as in Delphi where you can just use a default function to read a bitmap or JPG and use it to fill out a designated area in a window (and the same goes for exporting).

Don't worry about it if I'm the only one who would like an import/export function, I've finally found a way to create heightmaps which don't look like rice paddies.

Link to comment
Share on other sites

I just emailed you a PNG file created with geomorph.

It's not hard to get access to linux. There are linux versions you can run directly from CD, without needing to install anything. Knoppix is one example:

http://www.knopper.net/knoppix/index-en.html

(You can download a free CD image file)

However if you plan to really work with linux you should have a permanent linux partition on you hard drive. It's easier to set up than most people think.

[ July 08, 2006, 07:37 AM: Message edited by: tankibanki ]

Link to comment
Share on other sites

×
×
  • Create New...