Jump to content


Photo

Importing 1 metre height data

Height Height data global mapper Error unity help

  • Please log in to reply
12 replies to this topic

#1 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 29 July 2014 - 08:36 PM

Hi all!

 

I have a quick question that I hope some one can clear up for me.

 

I've managed to obtain 1 metre ascii of a local course which I then imported into global mapper to produce a height map in RAW format. When I then import the RAW image into unity to produce the terrain It either appears extremely flat as shown in the attached image, or contains a lot of steps rather than a smooth transition from one height to another.

2md566f.jpg

I would really appreciate it if someone could help me out.

 

Thanks



#2 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 29 July 2014 - 08:49 PM

Here's an example of the 'stepping' I get when try a different method of creating the height map.

 

11gokdk.jpg

 

Any Ideas?

 

Thank you



#3 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 30 July 2014 - 12:00 AM

From the large walls in your images, it appears you are not correctly scaling and offsetting your elevation values in GlobalMapper. There will be an option on the elevation data layer to do this.

 

For example, if your course ranges in altitude from 2000m to 2050m, you'll want to get rid of that base 2000m offset, like the course was at sea level. If you leave that offset in, your terrain in Unity will be 2000m up in the air with only a small portion of your 65 thousand vertical resolution to represent 50m. That could be the stepping.

 

You'll also want that 50m height range across the course to occupy the full height range allowed by RAW file. This is why scaling in GlobalMapper is needed. This could be the reason for the flat image.

 

The thing about RAW files is there is no standard--they're just a bunch of numbers which can go from top right to bottom left or any other sequence. Importers like Unity must be told the specs of the RAW file coming and will glady accept even 32 bit RAW files if the number of samples is right. It won't process them correctly though.

 

You may even find GlobalMapper's RAW format is undecipherable by Unity. In that case you would need to export it as something like GeoTiff, and convert it to RAW in something that Unity does understand (like Photoshop).

 

The other thing you'll highly likely have to do is rotate and/or flip your height map in something like Photoshop to match your overlay image. Plus ensure your scaling and offset in GlobalMapper give room for bunkers and water beds to be dug out,

 

Before readers freak out thinking they'll need to know this stuff, they won't. Terrain Forge exists to solve these complications.


  • TheBigYin519 likes this

#4 Kablammo11

Kablammo11

    Obscure Person

  • Members
  • PipPipPip
  • 3,953 posts

Posted 30 July 2014 - 06:13 AM

My two cents: The terrain width and length as seenn in your inspector are quite small for a golf course. Also, since they do not form a perfect square, your terrain grid will become distorted. The recommended height map resolution in CF is 2049 (4+ mio vertices) - with 4097 (16+ mio vertices) you might get performance issues.

Your terrain height of 20 strikes me as a bit low - either that or your plot of land is quite flat.

 

The staggering you experience must be a consequence of the graphic resolution of your raw file, which strikes me as quite low. You can get rid of it quite easily with a Unity terrain engine smooth brush or by applying a gaussian blur in Photoshop previous to import.  Or - I don't know if this is possible - you could try to increase its resolution in your global mapper.

 

As shimonko pointed out, you usually need to flip your raw file vertically before import, for it to represent properly in Unity (The terrain texture is projected onto it from the top down, the height map pushes the terrain from the bottom up, hence the need to flip it)

 

Don't be too discouraged, these are basic teething problems we all encountered and overcame at some stage.


>>>>>>> Ka-Boom!





• Mulligan Municipal • Willow Heath • Pommeroy • Karen • Five Sisters • Xaxnax Borealis • Aroha • Prison Puttˆ

• The Upchuck   The Shogun  • Black Swan (•)

 

<<<<<


#5 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 30 July 2014 - 10:00 AM

Thank you both for the quick responses. I'll be testing out your suggestions when I finish work and i'll post the results.

 

Thanks again, I really appreciate it.



#6 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 30 July 2014 - 08:52 PM

Ok guys so this is where i'm currently at. I'm finding it rather frustrating arghh!

 

oqvwg1.jpg

 

Thanks again.



#7 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 31 July 2014 - 01:30 AM

A couple of things wrong:

  1. You haven't done the scaling of elevation data I mentioned. If you're exporting a 16 bit GeoTiff, then you have to scale your elevations so that your minimum course elevation = 0 and max course elevation = 32767. Otherwise Photoshop will just see a 20m elevation as 20 on a scale of 0 - 32767, which will look black like you're seeing. Your 16 bit GeoTiff will have the actual elevation values in it, not greyscale values.  
  2. Don't specify the output size in the tiling options, as this will just crop/pad the image like you're seeing.  I can see on your first dialog above a "Sample Spacing" - this is one way of determining your output size. If your patch of land was 1500m x 1500m and you wished a 2049 height map, make sample spacing = 1500/2049. The other way is to leave sample spacing alone and resize in Photoshop (with bicubic smoother interpolation).


#8 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 31 July 2014 - 06:24 AM

Thanks again for the rapid response.

Maybe i'm a little confused with the scaling of the elevation data. So to clear it up I need to: subtract the minimum elevation from the maximum elevation. but then what is my next step to get it into a 32767 range.

Sorry for the basic questions.



#9 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 31 July 2014 - 08:31 AM

Example: Course minimum elevation = 220m, max elevation = 250m.  Elevation range = 250-220=30m

 

You want scale your elevation data so 220m = 0 and 250m = 32767.

 

Therefore scale = 32767/30 = 1092 , and offset = -220 * 1092 = -240291. 

 

Now you just need to find in Globalmapper where to enter these values to modify your elevation data, but that's 1 minute Google stuff. If it applies offset before the scale, then offset would just be -220.


  • TigerTiger likes this

#10 TigerTiger

TigerTiger

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 31 July 2014 - 09:35 PM

Shimoko, I just want to say a massive thank you for your assistance!! I really do appreciate it.

Here is a quick screenie of how my terrain currently looks. 

 

2lnh5ox.jpg


  • shimonko likes this

#11 shimonko

shimonko

    Advanced Member

  • Members
  • PipPipPip
  • 1,718 posts

Posted 01 August 2014 - 12:14 AM

Glad to see you got it. I do like the warm glow on the trees. 

 

You can check your elevations are as you expect by shift-clicking on parts of the terrain with the 'Paint-Height" tool and seeing the value it reports.



#12 Andrew

Andrew

    Administrator

  • Administrators
  • 2,524 posts
  • LocationUSA

Posted 16 August 2014 - 10:07 AM

One thing to be aware of when you set your bounds to 32767 is that the bottom of your heghtmap will be at its very bottom value.  This means that you will be unable to lower any of those verts below that point and moulding terrain around that will be hard.   Same for the top.  We recommend using a slightly narrower range and giving you a little flexibility



#13 Bruce R

Bruce R

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts

Posted 31 January 2015 - 12:18 PM

Thanks Chaps for a begginner to unity, being able to choose certain topics placing them in  Word, as well as d/l videos off the web, I am greatful to all of you for you wisdom on terrain and other important features of unity and CF, as well as working with height maps, I understand certain features of Unity are available in the paid pro vers, such as lighting, skybox makes up for some of that as does features in PS which also will help me.


CGX Bruce R






Also tagged with one or more of these keywords: Height, Height data, global mapper, Error, unity, help

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users