L3DT users' community
Large 3D terrain generator

Still having trouble with my heightfield

Got a problem or need advice?

Still having trouble with my heightfield

Postby Thing 2 » Wed Jun 14, 2006 5:58 am

Ok, I imported my heightfield no problem. I'm pretty sure my problem has to do with my min and max altitudes.

It's a 16-bit png, when I import it I get the Heightfield Import Options dialog and if I click on Options is says BitDepth (Comboselector) = "16-bit".

The png itself measures 640 by 640

I tried viewing it in L3DTVi2 and it just froze, I exported it to VTP Enviro and all I could see was a small stretched..something, right in the center.

We're hoping to be able to do an altitude of around 3000m as well as leave some depth under the ocean but, this is negotiable. Obviously we want our terrain to look natural regardless of the end altitude. Like I said, I'm pretty sure my problem has to do with my altitudes.

I need some help understanding. This is what I did exactly:

on the Heightfield Import Options dialog I changed min alt to -1875 and max alt to 3000, and set Horiz scale to 2.

What I did was try a bunch of different minimum altitudes to try and get my sea level where I wanted. I wonder if that wasn't my mistake. Anyway, I zoomed in and noticed that there's like a 700m drop from my coastline to the first shade of gray that is the ocean....

Oh yeah, when I get through all the steps in L3DT and save the project, it tells me the design map isn't initialized so I clicked Generate from HF. Got through all that but when I open it again it gives me an error. Something about a format that isn't fully supported, png used for heightfield and to please select a native file format.

Thanks Aaron,

Jay
Thing 2
Member
 
Posts: 12
Joined: Sun Apr 16, 2006 3:06 pm

Re: Still having trouble with my heightfield

Postby Aaron » Wed Jun 14, 2006 12:10 pm

Hi Jay,

Thing 2 wrote:I tried viewing it in L3DTVi2 and it just froze, I exported it to VTP Enviro and all I could see was a small stretched..something, right in the center.


L3DTVi2 hangs when the heightfield is not saved as a 'HFF'. To fix this, load your map, go to 'File->Preferences', select 'Heightfield->HFF (L3DT)' and click on the 'Use format' button. Click OK, and then save your map.

If the scaling in Enviro is wonky, then the horizontal or vertical scaling is probably incorrect.

Thing 2 wrote:on the Heightfield Import Options dialog I changed min alt to -1875 and max alt to 3000, and set Horiz scale to 2.


With a horizontal scale of 2m, you map is about 1.2km wide (~0.7 miles), and about 5km high (~3 miles). That seems very steep. Since you want to keep the horizontal scaling for FPS-reasons, I would recommend you decrease the min/max altitudes considerably (-180 to 300, for example).

Thing 2 wrote:What I did was try a bunch of different minimum altitudes to try and get my sea level where I wanted.


It's easier to do this after you've imported the heightfield, using the 'Operations->Heightfield->Change vert. scale' option.

Thing 2 wrote:Anyway, I zoomed in and noticed that there's like a 700m drop from my coastline to the first shade of gray that is the ocean....


That sounds like an 8-bit quantisation problem. How did you make the 16-bit PNG? (i.e. in what program?) Better still, can you post it here or e-mail it to me?

Thing 2 wrote:Oh yeah, when I get through all the steps in L3DT and save the project, it tells me the design map isn't initialized so I clicked Generate from HF.
Got through all that but when I open it again it gives me an error. Something about a format that isn't fully supported, png used for heightfield and to please select a native file format.


Whoops, L3DT is not supposed to let you save the heightfield as a PNG (only export it) - another thing to fix for v2.4! The work-around is to change the heightfield format to HFF, TER or BT before you save your project (HFF is recommended if you want to use L3DTVi2). This is using the 'File->Preferences' option I mentioned above.

Now, since I believe you want to make a really big map, you might like to check-out the import design map option. This will let you turn your 640x640 image into a heightfield up to 40960x40960 pixels in size (or less if down-sampled). Something to think about, perhaps.

Cheers,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia

Postby Thing 2 » Fri Jun 16, 2006 5:33 am

Thanks Aaron, I changed my PNG to an HFF then I followed through the import design map page, thanks for that.

On the Import design map window I checked the box that said "Specify DM size" and was quickly informed that 128 would be the max. It told me that the HF size would be 8192 pixels. Anyway, then I unchecked "Use disk-drive paging" and clicked Next and then Ok with no changes.

I ended up with a nice big design map but when I click Next and do the Water Flood tool, I just clicked Next and Ok no changes and got an error:

CSubMap::InitMap error:
- calloc failed to allocate 512MB of RAM (insufficient system memory?)

CMapWrap::InitMap error
- cannot allocate SubMap

CMapGroup::WM_FloodPlane error
- cannot initialise map

CMapGroup::WM_FloodAll error:
- Call to WM_FloodPlane failed


I have 1280 (a gig plus a 256) of RAM and I didn't have anything else running at the time. Do I just need to tone it down?

You are correct we would like our island to be as big as it possibly can be. It says my Map Area will be 16x16km, is there any possible way to make it any bigger while maintaining our limitations of ~1gig filesize and competitive level of detail?

Cheers, I'm having one right now =)
Thing 2
Member
 
Posts: 12
Joined: Sun Apr 16, 2006 3:06 pm

Postby Aaron » Mon Jun 19, 2006 4:30 am

Hi Jay,

As I mentioned in another thread recently, water-flooding on a 8192x8192 heightfield takes 1.13Gb of RAM, so you've probably run out of available RAM. Things should be OK if you split your heightfield into a mosaic using the 'operations->active map->split to mosaic' option (when viewing the heightfield).

I've just tested this here on an 8k x 8k mosaic heightfield, and it works fine (only 1Gb of RAM in this 'puter).

Thing 2 wrote:On the Import design map window I checked the box that said "Specify DM size" and was quickly informed that 128 would be the max. It told me that the HF size would be 8192 pixels. Anyway, then I unchecked "Use disk-drive paging" and clicked Next and then Ok with no changes.


For maps larger than 8k x 8k you need to have that 'use disk-drive paging' option enabled. It turns itself on automatically when you try to make a design map larger than 128 x 128.

To keep your heightfield under a gigabyte, I recommend that when you import your heightfield as a design map, specify the design map size to be 320 x 320. This will give you a map that's 20k x 20k pixels, taking 800Mb on disk (assuming the HFF format is used). That covers 40km x 40km (~25mi x 25mi) with your heightfield resolution of 2m/pixel.

Oh yeah, a few other things: I had a look at your PNG and that 700m drop-off you mentioned is there in the image (there are no values between 7424 and 9984, or 29 and 39 in 8-bit mode). Also, the image appears to have either been made as an 8-bit image, or else saved as one at one point in time. I say this because there are ‘steps’ of 256 between values in the image histogram. This means that, while the image has been saved as a 16-bit PNG, the data is still effectively 8-bit. That doesn’t matter much if you’re importing your heightfield as a design-map though, as the 8-bit ‘step’ artefacts will be obliterated when L3DT generates the heightfield from the design-map.

Ciao,
Aaron.
User avatar
Aaron
Site Admin
 
Posts: 3696
Joined: Sun Nov 20, 2005 2:41 pm
Location: Melbourne, Australia


Return to Help and support

Who is online

Users browsing this forum: No registered users and 10 guests