Importing Heightmaps
by Jason Nabors · in Torque 3D Professional · 08/11/2009 (6:58 pm) · 18 replies
Are there any known issues with RGBA opacity masks and heightmap sizes of 4096?
I followed the doc's and did the prairie example just fine.
That used seperate masks for each material though.
I imported the heightmap 4096x4096
Added the 4 layer rgba .png opacity.
Set each of the layers to a material.
Then clicked import.
This is when Torque produces a runtime error.
Anyone have any tips?
I'll try reproducing the error with lower resolution in case it is a memory issue. Although I have 8 gigs.
I followed the doc's and did the prairie example just fine.
That used seperate masks for each material though.
I imported the heightmap 4096x4096
Added the 4 layer rgba .png opacity.
Set each of the layers to a material.
Then clicked import.
This is when Torque produces a runtime error.
Anyone have any tips?
I'll try reproducing the error with lower resolution in case it is a memory issue. Although I have 8 gigs.
About the author
#2
08/11/2009 (8:08 pm)
I was able to do a 1024x1024 just fine with the same procedure.
#3
Memory Usage was around 5.9GB out of 8.0GB.
Here's a pic:
08/11/2009 (9:04 pm)
I can import the terrain without the textures just fine. Even though it really has a texture placed on it "No Material".Memory Usage was around 5.9GB out of 8.0GB.
Here's a pic:
#4
08/11/2009 (9:09 pm)
I haven't tried with the new Beta, but found in Beta 3 that I could import a hightmap of that size only if I did not try to texture it at the same time. I decided to just go with a smaller map and plan to look into multiple tiled landforms.
#5
In future T3D releases we'll begin supporting multiple terrain blocks stiched together with a nice GUI tool for managing them.
08/11/2009 (9:50 pm)
4096x4096 is huge for a single terrain block... all the memory usage is tied up in the collision representation of the terrain. I highly recommend you consider going down one size or more.In future T3D releases we'll begin supporting multiple terrain blocks stiched together with a nice GUI tool for managing them.
#6
08/11/2009 (9:58 pm)
Thanks Tom, I was just trying to push the engine some. The terrain I have there is Mons Olympus area on mars. So it has to be huge. I set the meters per pixel at 50 and the height at 2047. It takes many minutes on the fastest camera speed to go all the way across the map. I also notice I could not go higher than 2047 for the height, because when I did, the terrain became flat. I don't know if it had something to do with the engine or the file. But I wasn't able to go 2048 or higher in that field.
#7
08/11/2009 (10:36 pm)
I rescaled it to 1024 and everything went fine. Still couldn't go above 2047 in height though.
#8
same terrain with new textures

inside the Caldera

Inside the Caldera at night
08/11/2009 (11:47 pm)
Here's some more before i hit the sack.same terrain with new textures

inside the Caldera

Inside the Caldera at night
#9
@Jason: Nice. How did you smooth the terrain? Smooth Heightfield?
08/12/2009 (12:21 pm)
@Tom: That would be awesome. Would make life way easier.@Jason: Nice. How did you smooth the terrain? Smooth Heightfield?
#10
08/12/2009 (12:51 pm)
Quote:Still couldn't go above 2047 in height though.Thats an old hard coded limit in the engine that isn't very simple to change without breaking alot of stuff. Its on my list of things to fix in 1.1 or 1.2.
#11
@Ryan, I could make a resource, but here is what I did.
Downloaded 3DEM freegeographytools.com/3dem_setup.exe
Download Mars MOLA MEGDR data (all the megt*.* files)
pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg128/
Download L3DT www.bundysoft.com/L3DT/downloads/standard/L3DT_SE-2.7.exe
NOTE: Just going to be brief here. Maybe I'll resource it if there is enough interest
[3DEM]
Use 3DEM to select a part of mars you wish to use, export that as a
.ter(terragen) file.
[/3DEM]
[L3DT]
Use L3DT to load the .ter file as a heightmap. Do whatever processing you want in L3DT.
Save the heightmap file as a .png
Generate AlphaMap file and save as .png
Gather the texture files from L3DT or generate your own.(in this case the desert sandy one was with L3DT textures and the redish brown textures I created my own.)
[/L3DT]
[Torque 3D]
Use torque 3d and import the heightmap .png
add the alphamap .png and select the textures you want to use for the RGBA
[/Torque 3D]
I didn't modify the result with any of the torque 3d tools, that's just the way it came out.
08/12/2009 (1:36 pm)
@Tom, K thanks, wasn't sure if it was something I was doing or not.@Ryan, I could make a resource, but here is what I did.
Downloaded 3DEM freegeographytools.com/3dem_setup.exe
Download Mars MOLA MEGDR data (all the megt*.* files)
pds-geosciences.wustl.edu/geo/mgs-m-mola-5-megdr-l3-v1/mgsl_300x/meg128/
Download L3DT www.bundysoft.com/L3DT/downloads/standard/L3DT_SE-2.7.exe
NOTE: Just going to be brief here. Maybe I'll resource it if there is enough interest
[3DEM]
Use 3DEM to select a part of mars you wish to use, export that as a
.ter(terragen) file.
[/3DEM]
[L3DT]
Use L3DT to load the .ter file as a heightmap. Do whatever processing you want in L3DT.
Save the heightmap file as a .png
Generate AlphaMap file and save as .png
Gather the texture files from L3DT or generate your own.(in this case the desert sandy one was with L3DT textures and the redish brown textures I created my own.)
[/L3DT]
[Torque 3D]
Use torque 3d and import the heightmap .png
add the alphamap .png and select the textures you want to use for the RGBA
[/Torque 3D]
I didn't modify the result with any of the torque 3d tools, that's just the way it came out.
#12
08/12/2009 (1:47 pm)
Did you still use 50m/square? I've only been using 1m/sqr (4 tops) so that might be it too? My heightfields sort of go into torque looking a bit like lego.
#14
www.garagegames.com/community/forums/viewthread/99273
I'm getting some odd results, any ideas?
08/12/2009 (2:29 pm)
@Jason: Would you mind taking a look at this for me? (see post #10)www.garagegames.com/community/forums/viewthread/99273
I'm getting some odd results, any ideas?
#15
my email is jamen@cox.net
08/12/2009 (3:27 pm)
Like Tom said in that thread, it looks like you may be using 8 bit heightmap. Can you send me the heightmap you are using? I'll see what results I get.my email is jamen@cox.net
#16
08/12/2009 (3:38 pm)
sent :)
#17
Sent the fix to you in the email, for those of you following this and use GC2,
1. export from GC2 as a .ter
2. import into L3DT the .ter as a heightmap
3. export the heightmap as a .png(watch the size, noticed it added a pixel)
4. import into torque 3d
basically GC2 has problems exporting the terrains as anything other than 8bit. .ter export seems to work well though, just have to convert it once more using L3DT. I'm sure other programs may convert as well, but I use L3DT.
08/12/2009 (5:11 pm)
@Ryan,Sent the fix to you in the email, for those of you following this and use GC2,
1. export from GC2 as a .ter
2. import into L3DT the .ter as a heightmap
3. export the heightmap as a .png(watch the size, noticed it added a pixel)
4. import into torque 3d
basically GC2 has problems exporting the terrains as anything other than 8bit. .ter export seems to work well though, just have to convert it once more using L3DT. I'm sure other programs may convert as well, but I use L3DT.
Torque Owner Ryan Neighbour
Default Studio Name