problems with hightfield load terrain / size

Started by tablerock, September 14, 2011, 08:47:57 AM

Previous topic - Next topic

tablerock

Hello, I´m new here and used to work a lot with terragen classic before I now changed to T2.
hope my english is ok for you to understand (I´m from Germany).

My problem is, that many nodes are not described in detail, so most time I use try and error, but this doesn´t always help.

I use a heightfield load terrain for instance, which is looking quite good.
After all I´m not sure if the dimensions of the terrain fit correctely to the Terragen 2 measurement, because there a many wrong results visible.

The loaded terrain is a greyscale bmp picture which was created by a demoversion of global mapper. Since the demoversion is not able to save pics, I just used the Windows snipping tool and a maximum display of my screen, to get as much details as possible.

I guess this "rough" screenshot will not have any correct size information, Terragen could somehow "read", but for the first steps it was ok.

I had to use a hightfield adjust vertical node to give terragen 2 the right altitude information of the greyscale picture (brightest color for highest point ... darkest color for lowest point).
Then I had to add 1000 meters to the terrain and it almost fit to the real altitude information of the real area (italian alps).
In the 3D preview window, I was able to check if the different areas have the correct y-data. So I was pleased with this step and started to work on my project.

When I used some objects (free xfrog objects from the planetside page) to populate them, I was wondering that the size did not fit.
In the object node I had to use an object scale from 0.2 to 1 which makes the objects smaller so that they look more natural in my project.
While in the grass-clump node, the blade lenght of 0.3 means 0.30 metres long blades, I thought that in the object node the scale is similar, so 0.2 to 1 should lead to trees, which are only 20 centimetres to 1 meter high. But in my rendering results the trees are still to high...

Another problem : While in the 3D preview window, I can see the right y-coordinates (altitude) of an area, the shaders do not work right.
I always have to add the 1000 metres from the heightfield adjust vertical node in every altitude constraints box... so if I want to start the snow shader in 2500 metres I have to set the "limit minimum altitude" to 3500 ! (without any fuzzy zone).
Why are the shader nodes different from the adjusted terrain ?

But my most difficult problem is the size of the terrain.
With the measuring tool I was told that my area is 110 km wide (x data).
In the real map it is only 40 km ....

So I tried to use the heightfield resize node and placed it between the heightfield load and the heightfield adjust (it was placed there by default).
Now I can edit the resize node, but I don´t understand it.

I tried "resize in metres" and changed the size from 10000 to 40000 (just an attempt to see what the node is doing)
But nothing happened ! The measurement tool in the 3D preview still shows the same size information (110 km)...
I can not see any changes ? So what is this node about ?

The node referrence from the Terragen WIKI page says nothing about the values (it only shows how the node dialouge box looks like).

I would like to resize the terrain (including altitude information) so that it fits to the real area from which the hightfield picture was taken...
But without node-function understanding, it is quite hard to get there...

I know that a screenshot is not the best way to create a heightfield greycsale terrain, but it worked in Terragen classic absolutely well.

Oshyan

The scale of imported objects is a multiple of their "native" scale - the scale that they were built/saved at in 3rd party apps. So imported object size is not (currently) measured in meters. That explains your scale issues.

I can't reproduce the issue of a rescaled terrain treating altitude constraints differently, but if you're working far from the 0,0,0 coordinate origin, that may have something to do with it.

However it sounds like most of your problems would be solved by either buying Global Mapper so you can properly export the terrain with scaling info, or using a different DEM converter. If you can get the data in GeoTIFF format, TG2 can load it natively.

- Oshyan

tablerock

#2
Well, I have one little project which uses DEM data. I only checked the demo versions of all kind of DEM converters to see if I can get a greyscale pic out of them. Global mapper was the first I found, which lead to good results on the screen. But I don´t think that it is neccersary to buy an expensive programm like global mapper for only one little job - which is of course not commercial and only for private use.

So please ignore the source of my greyscale pic - just in case it was not from a screenshot - or it was not made by a DEM converter...

I have a greyscale pic which is 1448 x 912 pxls. So I have an aspect ratio of about 1.5877 (rounded).

When I go to the heightfield load shader node, I have there the georeference option.
By enabling this and using the following coordinates, I get the right results...

NWcornerLatLon 1 / 0
NEcornerLatLon 1 / 1.5877
SEcornerLatLon 0 / 1.5877
SWcornerLatLon 0 / 0

Ok - with this I corrected the aspect ratio (why does T2 import a rectangle pic into a square shape ???).
The Terragen2 measurement tool is now telling me, that my area is about 177 km wide.

So my next idea was to change the coordinates into smaller numbers.
The 177 km in T2 are in reality 40 km. So I substitute the "1" from the coordinates above by a 0.226 (40/177).
I also substitute the 1.5877 by 0.359 (0.226 x 1.5877).

The result is, that my area in T2 is now 40 km wide and has the right aspect ratio. So up to here, it all works well.

Now that I made the area smaller, the altitudes have to be corrected, too.
So I use the heightfield adjust vertical node and enable the set height range funcion.
I thought that this will work in the way, that the brightest greytone is set to the highest altitude, and the darkest greytone to the lowest part of the area.
Now that I know the data from global mapper (shown on the screen) I was able to use the data here.
But after this - the altitudes in my area are still not right. The lowest areas are at -1000 meters, and mountains which are in reality 2400 meters high are only 400 meters now...
So I used the multiply and add altitude function to correct the area. As I already mentioned, this did not lead to the correct results in the shaders...

When there is a node, which function it is to correct the altitude of an area - and it is a quite helpful node - why are the shaders ignoring it ?

With other words - ignoring the source of my greyscale pic - I was able to adjust the size and the altitude with the intern tools of T2.
I can check the result by using the measurement tool - the size of the area is now right - and the altitude is more or less right (not everywhere - this may be a result of the screenshot step and the color resolution of the windows snipping tool).
But when the measurement tool gives me the right size and altitude data - why do the shaders ignore them ?

That´s quite strange to me - and I think I did oversee something.
 

Oshyan

I'm afraid I really can't follow how your scene is setup just from the description, nor have I been able to reproduce the issues so far in testing with my own files. If you need this to be further diagnosed please send all files involved (including the images, of course) to support AT planetside.co.uk.

Thanks!

- Oshyan

tablerock

#4
ok - I figured out something else by using a new greyscale picture (same area, larger picture with more details).

My first mistake was to check the "geoference" button, so Terragen already altered the loaded area (for instance the aspect ratio)
I also figured out, that T2 sets each pixel of the greyscale pic equal to one meter, by leaving the geoference butten unchecked.
So my new greyscale picture of 5750 x 3620 pxl leads to an area which has the size of exactely 5.750 km x 3620 km (which is a lot smaller than my first greyscale with the checked geoference button was).

This way I had a good foundation for understanding what Terragen does with loaded heightfield pics. I also solved the wrong aspect ratio by this.

But my basic problem remains.

As soon as I use the heightfield resize node - which now works correctely because the geoference button is not checked anymore - the size of the area is about the size I want to have it.
Of course I still have to fix the altitude information.
For this I need to use the heightfield adjust vertical node again (I know no other way).

Now that I use the correct heights (in my example 3893 m for the highest point, and 194 meters for the lowest) I even get the right altitudes in my terrain.
So up to here all is ok.

But as soon as I take a look at the terrain in the 3D preview, all mountains seem to be higher than they should. The whole terrain seems to have a multiplied height, though all information the measurement tool gives me is correct (at several checkpoints, where the real heights are known to me).
This of course also leads to wrong slopes in the whole terrain, which has an effect to the shaders and objects, too...

So to get a realistic look of the terrain, I will have to use the heightfield adjust vertical node again, and change the altitude information there.
There are two ways for this : first is to uncheck the "set height range" function again, and trying to multiply the height by hand (in combination with add height) or leaving the "set height range" function and using a multiply value less 1 to lower the result. Both lead to a right look of the terrain, but then the altitude data in the terrain is not right at all (of course) and the shaders will not work as they should.

So what is left of my problem : Either the size/altitude information in the terrain is right and the look doesn´t fit to the real area, or the size/altitude information is not correct, but the look is ok.
With the second result I could work - but it leads to my problems in the shaders and the object scales again.
I would understand the problem, if the used greyscale pic would be in a bad resolution (it is not the best of course, because the snipping tool produced only jpg) and if the results would be absolutely incorrect.
But I am able to adjust the size and heights and can measure the right altitudes in several areas of the terrain - and there are no wrong heights at all ! So the adjusting seem to work quite good. Only the look of the terrain in the preview is absolutely wrong...

I do not understand why the terrain looks different to the reality when I have adjusted all proportions correctely ?

This is a problem most Terragen users might not have, if they work with fictonal terrains (generated) or if they have a perfect heightfield load from another terrain software and using the georeference button.

I´m afraid I can´t send the greyscale images, because I had to buy the DEM data and am not allowed to reproduce the information without permission of the owner (italian government).
But I could send some pics of the results and screenshots of the dialogue boxes. I will prepare this and will send you the examples.

RArcher

Sounds like you have too many variables that you are trying to fudge the numbers on to make things look "right".  I would think that it would make life much easier to use either 3DEM or Landserf (both free programs) to take the raw DEM data and output a Geotiff heightfield with the height data included.  This should then be in the right position and size on the globe as well as having the correct vertical height.

Oshyan

If, as I understand it, your workflow is still based on a simple screenshot of the terrain from the Global Mapper display window, then I'm afraid you really cannot make any assumptions nor rely on this for accurate results. There is no way around that.

First of all, the data is only going to be 8 bit, 256 levels of altitude max. Second, you have no idea how GlobalMapper - or indeed any other app - maps the terrain data. Human visual perception is not linear, so gamma may be applied to make the displayed map "look" correct, when the actual grayscale values are skewed from the real data. There are many other possible issues with the approach as well, including interpolation methods that the displaying software may use.

It sounds like you are basically sampling data through a very inaccurate and error-prone method, then using a combination of real-world measurements and visual analysis to determine that Terragen is wrong. While it's certainly possible it *is* wrong, there are so many other possible points of error here it's hard to offer much more suggestion than to start over with better data/conversion processes at this point. If you've paid for access to good data, you owe it to yourself and your project to take best advantage of it with good software and conversion processes.

- Oshyan

MKE

Quote from: Oshyan on September 20, 2011, 07:47:24 PM
If, as I understand it, your workflow is still based on a simple screenshot of the terrain from the Global Mapper display window, then I'm afraid you really cannot make any assumptions nor rely on this for accurate results. There is no way around that.

Hi Oshyan,

I agree that a hightfield crated by a simple screenshot  is no basis one should use for the further work with Terragen.

On the other hand, I think Tablerock runs into some similar problems I have and I use georeferenced geotif data. "Auto georeference from file" seems not to work. The "XY size [metres]" alway shows the number of pixels although all the needed information about pixel size and corner coordinates is in the geotif. I tried to increase these XY size values (e.g. for 30m x 30m pixels by the factor 30 each) but that didn't have any effect. The DEM with the correct height values always looks extremely steep. The only way I ended up with a "nice" heightfield in terragen was to use a "height multiplier" of 0.0333 = 1/30. The problem is that downscaling the DEM also effects the global illumination and if you are high enough, on the curvature of the horizon, as long as you don't reduce Earth to 1/30 of it's size...

Probably it's not really tested out using geotif or there's lack of documentation or both... ;-)

Kind regards,
Martin

jo

Hi,

The XY size (metres) fields don't have any effect. They're editable only so you can easily copy and paste the values. A really common problem was people loading files for heightfields and then not being able to easily figure out the correct size/aspect ratio for images overlaying them etc. The Statistics fields were added to the Heightfield load node to help with that and other things. These are "read only" type settings though, changing them has no effect.

I realise there is the potential for confusion with "XY size (metres)" looking like an editable param and not being one but that's a limitation of the param view UI system at the moment unfortunately. It was a bit of a tradeoff of usefulness for confusion.

To be honest I'm not sure how it would work with georeferenced files and there's a bit of a lack of documentation!

Regards,

Jo

tablerock

I was some days off, so I wasn´t able to reply earlier... first I want to say, that I understood the XY-size display as a read-only, but the funny thing is, that the measurement tool is telling me the same size information (metres = pixel). So I did not change the size in that xy-size fields to enlarge the area, but I used the heightfield resize node.

Now some words to the screenshot-methode : I expected those inaccurate data by using the windows snipping tool (win7) - so in my first attempts, I was quite skeptical about this, too.
When I wrote that the area looked fine to me, I did not mean the greyscale pic, I already meant the result of the terragen render.
The DEM data I use, is from an area I know quite good, and I have a lot of photographs from there, too. So I always had a good foundation to compare the reality with the rendered results.

Before I began to take care about the measurement of Terragen (having the right size and altitude data) I already was able to create good looking render results. I only had to add some hundret metres to the shader altitudes etc.. always comparing the results with the photographs.

So there is no visible problem in the screenshot methode, except I´m not able to adjust the terrain to it´s real sizes. The area, rendered from the screenshot greyscale looks really fine - there are so many details which can be found on the photographs too. There are no visible steps (low color space of screenshot tool) or things like this.

So I think, that it should not be a problem of the greyscale source. I also won´t say that Terragen is working wrong here - that´s not what my problem was about.
I just don´t understand how the resize tools work right (that´s what I think), because when I use them intuitive, I don´t get them working right...

To solve this problem, I will try to use another source of the greyscale pic (like 3DEM) to exclude the screenshot problem.

Anyway, I would appreciate to have some good tutorials about heightfield load / greyscale sizes / resize nodes ... just to understand it some better.
 

tablerock

Well 3DEM seems to be not able to read my DTM ASCII file correctely (it needs coordinates I don´t know)... I remember when I tried to use those data some years ago to create a greyscale from it, and only Global Mapper was able to read the DTM ASCII format right. All the other programs which are for free are either only viewers or can´t handle the format correctely without asking information I don´t have.
I tried 3DEM and it was not able to read ASCII (so I just used the file format .txt). Then I had to fill out a lot of boxes (matrix size, UTM zone and stuff like this) which I was able to find in my global mapper attempt. But I did not find any coordinate data in GM, so I wasn´t able to load the file. By using any coordinate data - the result was ... nothing.

So if anybody knows a freeware, which is able to import/load USGSDEM (DTM ASCII) and create a greyscale pic from it, I would be happy - because I did not find any...
I wished terragen would have a good import interface for all kind of DEM files, so I would not need another converter...

Oshyan

#11
Have you tried MicroDEM, Landserf, or even Wilbur?

- Oshyan

tablerock

Except Wilbur I already tried those programs some years ago - but maybe the versions improved, so I will give them a new chance.

So I used your links to download the latest versions of the software. I did not try them yet, so I will reply to the results later.
But I think I should warn about the microdem link !

While downloading the microdem software, I was warned about the software (Microsoft defender) but I kept going on downloading it.
When the install routine started, my Avira Antivir reported a fund in microdem :

found virus : TR/Dldr.Megone.chbl' [trojan]

I think this is not a false warning by my antivir software, so I just wanted to write it down here...

I will now try landserf and wilbur to see if they are useful, thanks for the links anyway :)

Oshyan

Hmm, sorry if I linked to something that might have a virus in it! I have removed the link for now. Maybe there are other sources you can find with an Internet search.

- Oshyan

tablerock

Ok I now also tried the other programs...

The Landserf installation routine is not able to create a folder in my program(x86) folder (!) so I just choosed another place to install it. But it still did not work :(
Then I tried wilbur (64 bit version) - the installation went well, but it is not able to import ASCII DEMs :(

I Think I will continue with my current terrain and don´t care anymore about the real measures. As long as everythink (tweaked) is looking good I will have to figure out the right sizes by try an error.

I´m still thinking about buying Terragen 2 Deep, but I wonder that there is no detailed information about all node parameters and their results (and workflows) available. As I already mentioned, the node referrence is not giving any information about the different parameters and what they do, there are only screenshots of the dialogue boxes without explaining them.
I think it is quite important to know how the different parameters work and what the results are. Terragen 2 is a very powerful tool, but without understanding all the nodes, it is hard to use the software in the most optimal way. Is there any book about terragen 2 available ? I think that reading through all the T2 tutorials is not the easiest way to learn about all possibilities of a software.
I did not find any terrain import tutorial for instance which is explaining all the terrain nodes.