Planetside Software Forums

General => Terragen Discussion => Topic started by: pw_evc on April 23, 2011, 10:57:29 PM

Title: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 23, 2011, 10:57:29 PM
Greetings!  I'm brand new to T2.  I've heard its a tricky program to figure out and unfortunately I now agree.  I want to create an animated "fly-thru" of an area that I have real geospatial data for (DEM, contours, high-res satellite imagery).  I started out trying to do Ryan Archer's "real-world data importing" tutorial, but I got stumped.  I got the "ReadImage: Unable to read image" message when trying to load the topographic map as an image map shader.  The LS7 imagery seemed to load properly as an image map shader, but I stopped at this point since the topo image map shader wasn't working.
I then moved on to try what I learned from his tutorial using my own data and got stumped again.  Instead of having rasterized topo maps, I have a shapefile of 2m contour lines.  I exported it from Global Mapper as a GeoTIFF and then loaded it into T2.  I didn't get any errors, but I don't see anything other than the color of the background in Global Mapper when I did the export.  I went ahead and tried loading the 50cm color imagery and that's when I got the "ReadImage: Unable to read image" message again.  The imagery file is a very large tif file (3.3GB) so that might be a problem.  I did smaller section of the area that was a 285MB tif file, but got the same result.
I've searched high and low for a good tutorial on importing real-world data, but can't find one.  It seems that all of the tutorials are geared toward creating fiction environs as opposed to viewing/altering non-fiction environs, which is what I want to do.  Ryan Archer's is good, but assumes you won't have any issues and doesn't give any troubleshooting steps.

If someone can provide me some simple how-to steps, I'd really appreciate it.
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 27, 2011, 11:35:00 PM
Hey all,

Please see the reply below from Oshyan in response to an email I sent to Terragen Support.

Me:
I work for a geospatial data supply company and have a specific area of interest I'm hoping to create scenes for and ultimately a fly-thru animation for a customer.  I have a 3m DTM as well as the 50cm imagery we created it from.  My thought was that with these two pieces of data, DEM and imagery, I could do this with T2.  It seems that the far majority of the forum is focused on creating imaginary terrains as opposed to viewing and manipulated real terrains.

Oshyan:
In regards to your specific issue, I think it would be best for me to reply on the forums so that everyone can benefit from the discussion. I will respond later today. But I will say for now that it's quite difficult to address issues like this without seeing at least example images and/or a TGD (Terragen 2 scene file) or screenshot of the node network. From what you describe it sounds like the LS7 data may not originally have been in a TG2-compatible format. Once you exported some of your data to GeoTIFF it sounds like it loaded, but perhaps it was georeferenced and so did not appear in your viewport. Alternatively, if you were already viewing a georeferenced terrain, and you loaded your image through the Image Map Shader, then it would *not* have been georeferenced and might not have appeared for this reason. Further, by default Image Map Shaders are only 1x1 meter in size, so if you did not specify the size you would also not see anything in the preview.

Hopefully that helps for now. I suggest you update your forum request thread with additional information and I'll respond ASAP.

Me:
Thanks for the response Oshyan.  I can't any of the imagery to show up as an image map shader in T2 at all.  I get the "ReadImage: Unable to read image" error everytime.  Because of this, I'm not able to try your suggestion of specifying the size.  Can I do this before it is loaded in? 

You might be on to something with the georeferencing.  My terrain files are georeferenced.  They have to be if they are coming from Global Mapper, right?  I'm now trying to figure out how to export the imagery from Global Mapper in a non-georeferenced format, but that doesn't seem to be an option, especially considering that the only file format available in GM that T2 can read is GeoTIFF, which inherently means "georeferenced." 
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 27, 2011, 11:41:07 PM
I should clarify: the Image Map Shader does not support georeferencing at this point. I was more referring to the difference between your terrain, which might be georeferenced (and in view of the camera) and your images, which would not be. Exporting the imagery in a format that is compatible with TG2 is all you should need, whether it has georef info or not (GeoTIFF should work, though it *does* have georef info, for example). For basic imagery data, it's probably best to export to a pretty standard format just to make sure there are no odd format differences. So use something like BMP, TGA, or even JPG (with high quality/low compression detail loss should be imperceptible).

So to reiterate, it sounds like your problem with the raster imagery is format-related. Get the data into a format TG can read and you can go from there with the sizing suggestions, etc.

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 27, 2011, 11:44:17 PM
That last message started to get hard to write due to its length.

Back to the georeferencing.  I'm making sure that all of the files georeferenced to the same projection, Geographic WGS84.  But according to your response, Image Map Shader aren't georeferenced even if they are exported from GM as georeferenced?

There are four files I'm trying to load to T2 for this.  
-2m DTM of specific area of interest
-90m SRTM DEM of much larger surrounding area
-50cm GE1 imagery of specific area of interest
-15m LS7 imagery of much larger surrounding area

My intent is to have the fly-thru start over the lower res SRTM/LS7 data, a ways away from the specific valley of study.  Then zoom in much closer to the 2m DTM/GE1 data and fly thru the valley.  The SRTM/LS7 data is mainly just "padding" along the periphery so the horizon doesn't suddenly drop off as flat on each side of the valley.  FYI-the valley data AOI is long and narrow, like a valley.  The larger AOI data is pretty much a square.

Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: RArcher on April 27, 2011, 11:47:50 PM
Sounds like you are having lots of problems all around, but one that immediately jumps out at me... Are you using the 64bit version of TG2?  If not then attempting to load a 3.3GB image file in is going to result in an error every time no question.

If you don't want the GeoTIFF to be georeferenced then simply uncheck the georeferencing options and it will behave like any standard heightfield.
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 27, 2011, 11:49:42 PM
Thanks for the new path to try Oshyan!  For some reason I was under the impression that I had to use a GIS-based file format for the imagery.  Probably because my work is in the geospatial data industry!  BMP, JPG.  Why didn't I think of that?  What is TGA?  Now, when bring the imagery in, say, as a JPG, it won't be georeferenced, right?  If my .ter file is georeferenced, how do I line them up?  Just put the imagery (image map shader) at 0,0,0?

Thanks for still being awake at this hour over there!
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 27, 2011, 11:52:22 PM
Quote from: pw_evc on April 27, 2011, 11:44:17 PM
But according to your response, Image Map Shader aren't georeferenced even if they are exported from GM as georeferenced?

That's correct, it's not supported for Image Map Shaders yet. That's why the workflow in Ryan Archer's tutorial (http://www.archer-designs.com/tutorials/terragen2/usgs-data-terragen-2/) suggests first for the terrain:
QuoteTo make your heightfield visible you will need to enter two values into the "Lat long at apex" fields contained within the Planet 01 object. What adding these two numbers does is recenter the 0,0 point of the planet to be located near your heightfield.
and then for the image overlay:
Quote...change the Projection type from "Through Camera" to "Plan Y (edges = XZ)" and enter the values found above into the Size fields. Then select "Position Center". You should now see your satellite image overlaying the terrain correctly.

What these steps do is first put your terrain at the coordinate origin so it's easier to work with, and then resize and reposition your terrain to match. If you don't do the adjustment of the Lat/Lon to coordinate origin, then it makes it much harder to line up image data. Since you're not even able to get the imagery loaded in the first place, that obviously needs to be tackled first, but after that you should be able to follow Ryan's steps to get the right result.

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 28, 2011, 12:03:52 AM
Thanks Ryan.  I actually tried your Vancouver Olympics real terrain demo, but got hung up on getting the topo map image map shader loaded to T2.  I was successful with the LS7 imagery image map shader though.

I believe I'm only using the 32-bit version because my OS is the Windows XP Pro 32-bit version.  I also mis-typed by referencing the wrong file.  It wasn't a 3.3GB file, more like 285MB.  However I do have a 1.2GB LS7 colored mosaic that I want to use as well as a 2.6GB GeoEye-1 mosaic of the area that want to use too.  Might be worth noting that these file sizes are based of the fact they are currently in ECW format and TIF format, respectively.  The size may come down a bit if I change them to BMP or JPG, as long as the resolution doesn't decrease too.  I guess if that's my only option, it'll have to do.

Lastly, what do you mean by simply uncheck the georeferencing options?  I can't find that option in Global Mapper.  
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 28, 2011, 12:06:32 AM
With a 32 bit OS and TG2 version you very likely won't be able to load your larger imagery data. If they're currently in higher bid depth (16 or 32 bits/channel), then the file size may come down when they're converted, but it may still be too large. Keep in mind also that if you compress to JPG, even if the file size gets much smaller, the actual size *in memory* when TG2 loads it will be an "uncompressed" size, e.g. BMP and JPG will be essentially equivalent in terms of memory use once loaded (however JPG would be smaller on disk, of course).

How much physical memory do you have?

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: RArcher on April 28, 2011, 12:12:24 AM
Try the tutorial that Oshyan referenced, it is a little more up-to-date with the latest TG2 release - http://www.archer-designs.com/tutorials/terragen2/usgs-data-terragen-2/index.html (http://www.archer-designs.com/tutorials/terragen2/usgs-data-terragen-2/index.html)

It should get you at least a little familiar with the process with georefereced data.  The Vancouver tutorial was written prior to georeferencing options being available (I should update this soon I guess).

With the 32bit version you are going to run into memory errors very quickly using such large data sources. As far as I am aware, it does not matter if you save them as a jpg or other compressed file because the actual pixel resolution once the file is uncompressed and loaded into Terragen is still very large.

You can uncheck the georeferencing features in Terragen 2 once you've loaded the GeoTiff if required, but it sounds to me like almost all your issues are either from not knowing the process for loading the data or memory related issues.
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 28, 2011, 12:57:59 AM
Thanks Oshyan and Ryan.  You've given me enough to try for now.  I'll try your suggestions and get back to you with my results.  I printed off Ryan's new tutorial and will give it a go tomorrow.  I'm excited!   

If I had a 64bit OS, would I not have these problems?  If so, I'll see if I can get my IT dept to upgrade me.  Regarding Oshyan's question about the amount of physical memory I have, here are the details of my local machine (Dell Latitude E6400 laptop):
Intel Core2 Duo CPU
P9500 @ 2.53 GHz
2.53 GHz, 3.48 GB of RAM
60GB Memory with only 12.4GB free

I have several TB's at my disposal on with our network drives, but I prefer to use my local drive since thats the fastest when working from home.  And yes, Ryan you are right about my issues seeming to stem from not knowing the process and now I'm realizing, memory issues.

Thanks again.  Hopefully I'll be back tomorrow with good news!
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 28, 2011, 01:09:16 AM
The problems you've been having seem unrelated to memory. However your future plans - once you address the initial problems - do seem to indicate you will run into memory issues fairly quickly due to large file sizes. A 32 bit version of Windows will only show up to 3.5GB of memory, as you can see from looking at your own system. This does not mean that's all you have, although it's likely you only have a total of 4GB. In that case upgrading to a 64 bit OS will help, but not much. Ideally you would also get a memory upgrade. I don't know how likely that is for your IT dept. to be willing to do, but for loading image files the size you have mentioned (especially multiple at once), you would want to have at least 6-8GB of RAM and a 64 bit OS.

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 28, 2011, 01:23:50 AM
Thanks for the advice Oshyan.  Since I have a plethora of very large imagery and dem files at my disposal (we are a geospatial data provider) getting the upgrades you mention seems to make sense.  I'm the marketer for the company and the intent of me purchasing and learning T2 is for me to create virtual fly-thrus of areas that we created DEMs for the sake of showing at tradeshows and perhaps our website. 

-Peter
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 28, 2011, 01:27:31 AM
Sounds like a great use for TG2. It should make your data look great! It's nice to see marketing digging in to the technical side of things too. :)

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 28, 2011, 01:33:39 AM
I'm actually finishing up my grad degree in GIS, but have gone away from actually practicing much GIS in my marketing role.  I'm hoping to delve back into it more with things like this.  I'm using this idea of landscape visualization for GIS purposes as the subject for my grad capstone project.  This case in particular, a valley in NW Argentina, we made the DEM for an eco-tourism customer with plans to develop this area.  I've been working with them and my hope is to deliver them a copy of the fly-thru video of "their" valley that they can then use for their own marketing purposes.  This could end up being a value-added service we offer to our customers, who knows?

-Peter
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 28, 2011, 01:37:33 AM
Very good ideas. I look forward to seeing the results!

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 28, 2011, 01:45:18 AM
Tool like this have great potential for use amongst urban planners, environmental planners, etc.  Can T2 visualize scenarios of water drainage/flow?  What I'm thinking is that it'd be awesome to be able to show a real hillside and the impacts/results (animation) of water flow patterns with various scenarios of land cover, ie. trees v. grass v. parking lot v. building.  I doubt T2 has this capability, but I thought I'd ask. 

Likewise for river flow and sea level changes.  Could I place a virtual dam on a realworld river and view the results?

Okay, enough from me.  Off to bed and I'll look forward to reading your response in the morning.

-Peter
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 28, 2011, 01:58:07 AM
TG2 can't actually simulate water drainage beyond an extremely simplistic and mostly random "river generator". However you could import river simultaneous in either image/image sequence (used as a mask) or geometry (particle simulation for example) using the new geometry sequence support (see 2.3 release announcement). So the actual simulation data would be generated in another app and then exported in a TG-compatible format.

You can however do flat bodies of water natively in TG, change their altitude/size, etc. So you could simulate damming a river to an extent, or water level changes throughout the season.

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 29, 2011, 03:19:31 AM
Ryan, I attempted your new tutorial, but didn't get very far due to a stall in the downloading data process. After clicking all of the download links beside each file, I got a bunch of small windows that said "Current order status. Adding your request to the queue... Please wait for the data to be returned."  Eventually they turned to "Current order status. Extracting data... Please wait for the data to be returned." All of this was expected to this point and I figured that another pop up would come up telling me the download is done and give me the option to open or save a zip file, but that never happened. 

Is this normal?  Does it just take a really long time (hours)?  Can you suspect any common mistakes I may have made? 

thanks,
Peter
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: RArcher on April 29, 2011, 10:18:23 AM
No that is not normal.  I would start with downloading one file at a time, not requesting them all be created at once.

The window should read:

1. Adding your request to the queue
then
2. Extracting Data...
then
3. Creating the archive file
then
4. Data extraction complete

At this point you will get a standard download box asking you where you want to save the file.  Unless of course you have your browser set to autodownload things and put them in a standard spot...

There will also be a link in the last window that says Data Extraction Complete that you can directly click on if the regular download box doesn't pop up.

All of this takes a couple minutes depending on how busy the server is and how large the data file you requested is, but it most certainly should not take hours.  Perhaps they were having server issues.
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on April 30, 2011, 04:12:30 PM
I finally got the USGS downloads to work.  My error lied in the fact that I overlooked this sentence you wrote in the last message, "There will also be a link in the last window that says Data Extraction Complete that you can directly click on if the regular download box doesn't pop up."  The exact line that comes up for me is, "If an error occurs during download, click here to retrieve the download bundle. After one hour, the download bundle will be automatically deleted from our server."  The word "here" is hyperlinked.  I click on that, and all familiarity returns. Perhaps you should include this little troubleshooting step in your tutoria.

Also, Terragen 2 completely crashes when I try load a JPG2000 file.  I assume this means it cannot read jp2 files, but wanted to confirm in case it does and I'm doing something wrong.  jp2 files are much smaller then regular jpg's, that's why I tried to use it.  I was successful at loading a jpg of my AOI into T2, but I had to dramatically reduce its size (PhotoShop) for it to work.  Time will tell if the resolution will be adequate.
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: Oshyan on April 30, 2011, 04:26:57 PM
TG2 does not currently support JPEG2000 files. Additionally, the size of the file will ultimately have no direct affect on the amount of memory it uses when loaded. Memory use is directly determined by the size of the image and its color depth and number of color channels as compressed images are decompressed before being usable in Terragen (and most any other application).

So for example:

A 1000x1000 image has 1,000,000 pixels.
For a color image, you have 3 channels, red, green, blue
Each channel normally contains 8 bits of data to represent the color value
There are 8 bits per byte
Thus each channel is 1 byte
3 channels = 3 bytes per pixel
Times 1,000,000 and you get 3,000,000 bytes or 3 megabytes.

So all that really matters is image resolution and color bit depth. In the case of GeoTIFFs they are very often 32 or 16 bits per pixel, but also often with a single channel (grayscale).

- Oshyan
Title: Re: Using T2 to create a "fly-thru" of a real valley
Post by: pw_evc on May 01, 2011, 05:15:55 AM
Okay, so I successfully completed Ryan Archer's USGS Elevation Data with Terragen 2 tutorial.  Now I'm trying to apply what I learned to my own data and it is not working.  The reason being that my image layer is much larger in memory size that T2 won't accept it.  I can't figure out to get the file size down.  I'm able to get it small enough as three separate images, but then I can't figure out how to get them to align properly in T2.