Jump to content

Tutorial: Converting a DEM to a heightmap


TrickyVein

Recommended Posts

Still can't get the grayscale settings to work right. Everything comes out spiky and distorted. I could really use some guidance.
Link to comment
Share on other sites

  • Replies 101
  • Created
  • Last Reply

Top Posters In This Topic

Yes, that was the most difficult part for me as well (as you can see from my earlier posts). It is really just a matter of trial and error. Honestly, you really just have to go by instinct. A higher or lower shade of grey makes all the difference. If your heightmap is coming out fine...and it's just spiky/distorted, then it's just your grayscale settings. Keep the values VERY close, and play with the numbers. Export and experiment again and again and AGAIN until you get it right.

 

Because of this process (and many hours of landscaping by hand afterwards), I was able to create terrain like this:

 

http://i1238.photobucket.com/albums/ff500/jeux793/Radiant%20Flux%20Screens/2012-07-04_00005.jpg

 

http://i1238.photobucket.com/albums/ff500/jeux793/Radiant%20Flux%20Screens/2012-07-07_00004.jpg

 

http://i1238.photobucket.com/albums/ff500/jeux793/Radiant%20Flux%20Screens/2012-08-02_00008.jpg

 

So just keep at it, alright? I gave up on this method for like...4 months before coming back to it again and mastering it. Thanks again Tricky!

Link to comment
Share on other sites

That's beautiful, Jeux. Reminds me of Tribes.

 

Sorry I've been away for a month and a half - Tetsuowrath, you'll have to be more specific. Applying a blur effect gets rid of most noise, or 'spikiness;' if you explain exactly what you're doing, step-by-step, I should be able to give you some advice.

Link to comment
Share on other sites

  • 1 month later...

Hey all, new to the forums here. Had some things I wanted to add to this discussion, since it helped me out greatly!

 

Tried all this, had pretty good measure of success; got my DEM imported into the game and currently tweaking my grayscale values to get the right height, but I'm pretty happy with what I have right now.

 

I noticed that VTP had another export option called "GeoTIFF" that worked much better than exporting as a BMP, since the GeoTIFF format is a 16-bit grayscale image, instead of 8-bit RGB. My version of Photoshop had no trouble reading the file and preserving the slope data, and when I saved the .raw files, they were exactly 2 MB like they should be. Photoshop won't actually show each level of gray, but if you hover your cursor over a pixel, the Info window (F8) should show you the value at that location (you might have to play around with the Info window's settings). Sweeping the cursor around will show you the various ranges in the area.

 

Another thing I noticed is that when the GECK Heightmap Editor imported the .raw files, it doubled the value of every pixel; so when Photoshop told me a certain value was, say, 800 units, the Heightmap editor would report the same area as 1600 units. I tried to incorporate this into my handling of the TIFF file and its values in Photoshop, but here's a list of conversions I tried to follow to my best effort:

 

  • The real-world location I'm reproducing ranges in heights from 4200' (above sea level, what I'm going to set as my local water level) to as high as 11,330' - that's a difference of 7,130 feet - well over a mile!
  • I figured every other wasteland was approximately 1/4 scale for good walking distances, which meant that height difference should be 1/4 scale as well.
  • According to the GECK wiki, 128 in-game units is approximately 6 feet.
  • The .raw image values are doubled when imported to the Heightmap Editor.
  • The Heightmap Editor sets water level (no matter what it is in the Worldspace settings) to a value of 4096.
  • The Heightmap Editor creates in-game values that are again doubled BUT using 4096 as a center point (so values below 4096 are twice as far below 4096, while values above 4096 are twice as high above 4096)!

 

Graah! That's a lot of calculation. In the end, I found that my values in Photoshop needed to range from ~1900 (for the underwater areas; water level would be 2048) to ~5600. It still seems a tad exaggerated, but I'll wait until I see it in-game before deciding for sure.

Link to comment
Share on other sites

Well, as a follow-up, I'm pretty convinced that the Heightmap Editor does NOT set local water level to 4096 as the wiki suggests. Is there any way to get the Z value of terrain once it's been generated?

 

And since I can't generate any World LOD without an almost immediate crash, I can't get a good long-distance visual assessment; though the initial settings looks pretty positive. Some locations will have to be re-painted by hand since I don't want EVERYTHING to remain at 1/4 scale, but relative slopes seem to match up.

 

Though I've also read (in the wiki) that they recommend water level being at least 10,500 units, which would mean my heightmap would need to be much brighter in order to raise everything up. Easy enough to do in Photoshop; I could simply create a new layer over my heightmap, fill it with a grey value of 5250 (remembering that everything gets doubled when imported to the Heightmap Editor) and set it to "Screen." That will add its value to those of the layer underneath. I must test this theory.

Link to comment
Share on other sites

Hmm. Never thought about exporting a GeoTIFF from VTP. That seems to make things much simpler, as you describe. But as the say, if it ain't broke, don't fix it. Exporting as a .bmp was working fine, so it never occurred to me to use a different format. I'll update the tutorial with this information.

 

You may want to explore using the 'levels' scalar bars to play around with while viewing the image's histogram in pshop. If you want to preserve some heights within some range of values while exaggerating others, for instance; because of this issue with x-y and z scaling not being exactly equal to each other (ideally, I think better results are achieved if one exagerates the elevation values relative to scaling northing and easting values).

 

As far as I can tell, from working across different worldspaces using different heightmaps, the default water height is whatever you set it to in the worldspaces dialogue. How this relates to some specific elevation in your heightmap image continues to elude me. I suspect the level of the water may correspond to the median value of your heightmap; adjusting the default 'land height' then allows you to position your land relative to sea-level. If it's not the median value, then it's something similar, and relative, because it's different each time.

 

When you go to generate terrain meshes, does the GECK actually crash? As I'm sure you've read, it takes an extraordinarily long amount of time to finish this process. I've only let the editor run for 14 hrs before getting frustrated and stopping the process while working on my current worldspace (which is only as large as a 1024x1024 heightmap! While others of the exact same size have finished overnight! What gives? Does the *extra* few cells I have rendered to the Northeast really expand the time it takes to create Terrain meshes exponentially???) Make sure that you have your .esp saved before going to generate terrain meshes.

Edited by TrickyVein
Link to comment
Share on other sites

My GECK actually crashes about five minutes into the LOD gen sequence (believe me, I know how to be patient with a working computer; I used to manage a 3D render farm). I read in another thread that the LOD generation algorithm "hates" flat areas and the more flat space you have, the longer it takes. Which sucks, because my terrain includes parts of the Salt Flats in western Utah. Guess I'll have to noise it up.
Link to comment
Share on other sites

That's interesting. I suspect this may be correct. The worldspace I am using - for which I have not been able to generate terrain meshes (since writing this post, I discovered that my landscape extended into a few errant cells to the West which was preventing terrain mesh generation. Deleting these allowed the GECK to work as usual) - covers the san francisco bay area, which means that >50% of the dem for the area is flat.

 

I am hoping this may work:

 

1) Make a selection of the underwater (or flat) areas using the magic wand using a very low threshold. Ideally 0, as I'm only interested in these areas.

 

2) Create clouds or a apply noise filter (and blur);

 

3) and blend this layer into the selected areas.

 

Here are the changes applied to the heightmap, before and after (which are close enough to the final result after some tweaking. Note that the red and blue colors represent values lower than those shown in yellow):

 

http://img577.imageshack.us/img577/5212/preaz.jpg http://img94.imageshack.us/img94/8223/antecg.jpg

 

This worldspace is an interesting case. The san francisco bay, of course, is quite deep. When scaling this depth with the x-y coverage of the area I'm interested in, however, the water level becomes pitifully shallow. I would like to preserve the heights *above* water level, but 'bottom-out' or drop significantly the height of the terrain *below* water level. It turns out you can do this pretty effectively using the levels scalar bars, but I'm still left with the issue of having extensive, flat terrain. Also, I don't care what the terrain actually looks like underwater. If you're dealing with this issue above land...yeah.

 

A second part of this tutorial should really be about image-manipulation/optimization.

Edited by TrickyVein
Link to comment
Share on other sites

In regards to the LOD generation time variations, and as Casey mentioned before, this has to be THE most informative post on the forums I've come across in regards to the matter:

 

http://forums.nexusmods.com/index.php?/topic/782478-generating-lod-one-cell-at-a-time/

 

More hills and ridges means less gen time? The flatter the terrain, the longer the cell takes to generate lod? Who would have thought...

 

You may want to add that last post in the thread to your tutorial for everyone to reference. It is very informative, as information on LOD is too few and far between. (and it is a pain to experiment with).

 

The bit about flat plains and smooth slopes taking longer to generate is a bit discouraging, for I've been planning on getting ready to design a worldspace with this type of layout in mind:

 

http://1.bp.blogspot.com/-aPSbf338akM/TzgjU0jui5I/AAAAAAAACZQ/FhfzBB7Fh-M/s1600/Gran+Pulse+2.png

 

Given that my island worldspace still isn't done generating LOD, and only 1/6 of it is the flat surface of the shoreline, I'm not too happy about that.

 

Casey, I too exported in GeoTiff and was able to skip a few of the tutorial steps. It was in 16 bit format and came out fine in the end. Very nice find, thank you. But I would not use the "screen" layering type when you could simply use of the filters to control the levels (Curve, Levels, etc). This is what I have been doing alongside Tricky's method to fine tune my elevation in the heightmap. Funny thing is, the terrain in Fallout (Gamebryo) is so...meh...that it really doesn't matter how well you "fine tune" the heightmap levels.

 

I've experimented with terrain in Unity and UDK, and I have to say that both had more impressive rendering features (obviously) and greater terrain detail. When it comes to Fallout...it's either lumpy, spiky, or flat. There's no abstract complexity you can implement here and there. So as much as I would want to create a vast tundra environment with snow-capped mountains, I would not be able to achieve that level of detail without using LOD models. I am sorry if I am not explaining myself properly.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...