Planetside Software Forums

General => Terragen Discussion => Topic started by: russe166 on August 18, 2014, 06:23:56 AM

Title: Geog heightfield load makes black image
Post by: russe166 on August 18, 2014, 06:23:56 AM
Hi!

I loaded the IMG from
http://wms.lroc.asu.edu/lroc/view_rdr/NAC_DTM_ARISTARCHU2
into the 'Geog heightfield load' and connected it with the 'Heightfield input' from the Heightfield shader.

When I render the image the colours are missing.

I don't now why?

[attachimg=2][attachimg=1]
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on August 19, 2014, 01:14:10 AM
Solution is here:
http://www.planetside.co.uk/forums/index.php/topic,18763.msg182622.html#msg182622

Best to only post one thread in the future. We look at all areas of the forums, so whether you post here or in Support you'll get a response. :)

- Oshyan
Title: Re: Geog heightfield load makes black image
Post by: russe166 on August 19, 2014, 06:39:36 AM
Hi Oshyan!

I thought this is the solution for the 'Geog image map shader', but in this topic I have the same problem with the 'Geog heightfield load' shader.

Do I have to convert the .img file to RGB?
Title: Re: Geog heightfield load makes black image
Post by: bigben on August 19, 2014, 09:47:08 AM
TIFF version works OK and is a smaller download. Will have a look at the IMG later after it downloads. 
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on August 19, 2014, 05:08:01 PM
Oh I see, I misunderstood. I think you understand that the Geog Heightfield Shader does not load or provide color, yes? So you mean that it removes color that was provided by other shaders? It looks like there is some severe data interpretation issue going on with height ranges or something. It's possible the IMG is formatted in a way Terragen does not expect, or that no georeferencing data is provided with it, meaning Terragen has to guess the height range or something. We use an open source GIS data loading library called GDAL, so our data interpretation and format support limitations are largely governed by that library's limitations.

Perhaps Ben will come up with some more info.

- Oshyan
Title: Re: Geog heightfield load makes black image
Post by: bigben on August 19, 2014, 05:46:00 PM
Heading off to work, but I'm not sure why the colour got removed based on what I saw with the geotiff.  It looks like the no data value is the centre of the moon so if you're not replacing it with a smaller value there will be some extreme displacement going on at the edge, but I don't get any problems like this with the geotiff. The files are lat/long projection but the data in it looks like it's sinusoidal projection so there will always be gaps of no data around the edges. 

I'd suggest overlaying these files with a wider area of lower resolution data (here's one I prepared earlier: http://files.bigben.id.au/terragen/terrains/moon/geotiff/ (http://files.bigben.id.au/terragen/terrains/moon/geotiff/)). QGIS is free. 

If I have a choice of data formats I usually go with geotiff as it plays nicer with more programs
Title: Re: Geog heightfield load makes black image
Post by: bigben on August 20, 2014, 09:23:31 AM
IMG loads OK for me, but it's better if you set the no data value. Don't forget to also change the radius/position of the planet
Title: Re: Geog heightfield load makes black image
Post by: russe166 on August 21, 2014, 09:53:36 AM
Thanks for your reply!

I tried the other .img files. Some have worked and others have not.  So I stick to the GeoTif but the landscape looks like a Minecraft level and is not smooth.

[attachimg=1]


Quote from: bigben on August 20, 2014, 09:23:31 AM
Don't forget to also change the radius/position of the planet

Do I have to change the radius of the Planet when I use a IMG file?
Title: Re: Geog heightfield load makes black image
Post by: Dune on August 21, 2014, 11:16:30 AM
Did you check smooth interpolation?
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on August 21, 2014, 12:39:15 PM
That looks like 8 bit data. Is that the GeoTIFF downloaded from the site you linked to?

- Oshyan
Title: Re: Geog heightfield load makes black image
Post by: russe166 on August 21, 2014, 12:53:40 PM
Hi!

I
Quote from: Dune on August 21, 2014, 11:16:30 AM
Did you check smooth interpolation?
Yes, I checked it but it does not make a big difference.

Quote from: Oshyan on August 21, 2014, 12:39:15 PM
That looks like 8 bit data. Is that the GeoTIFF downloaded from the site you linked to?

It is from the site I linked to. I cut out a part and saved it as .jpg so the size for the upload is not so big. I have the
same problem with the orginal .tif
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on August 21, 2014, 04:10:31 PM
That's the actual original file you got from the site just loaded into TG? I'm not seeing those kinds of artifacts here. Did you change any other settings?

- Oshyan
Title: Re: Geog heightfield load makes black image
Post by: bigben on August 22, 2014, 12:37:06 AM
I'm guessing you wimped out and downloaded the pyramidal TIFF because it's smaller. ;) Unfortunately pyramidal TIFF uses JPEG compression so it's only 8 bit. The other TIFF file is 32bit and will be smoother.

Changing the radius of the planet is necessary when you're dealing with data that uses degrees for lat/long. 1 degree on the surface of the earth is a much bigger distance than 1 degree on the moon. You'd be flattening the terrain by a factor around 3.5  Some projections though, use meters for lat/long which doesn't cause this, although you would be flattening the curvature of the planet relative to the terrain elevation in that situation.
Title: Re: Geog heightfield load makes black image
Post by: russe166 on August 22, 2014, 05:21:25 AM
Thanks to you all! You solved it  :)

I used the PRY.tif file and not the big one. So now it is working ...
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on August 22, 2014, 04:36:50 PM
Ugh, why would someone make a TIFF with JPG data in it, much less for GIS data!? *sigh*

Hehe, anyway, glad you got it working.

- Oshyan
Title: Re: Geog heightfield load makes black image
Post by: bigben on August 23, 2014, 12:13:55 AM
Certainly UGH for DEM anyway.  JPEG compression is used for TIFFs in business document scanners, and of course pyramidal TIFF. In the latter case it's mainly for really big images so that a) it gets around limits on image sizes for single TIFFs and b) is handy for streaming images. (e.g. this 2Gb image on one of our development servers: http://128.250.166.14/openseadragon.html (http://128.250.166.14/openseadragon.html)) Probably more of a historical thing so that you could at least preview the data without having to wait forever for the download.
Title: Re: Geog heightfield load makes black image
Post by: russe166 on September 30, 2014, 01:48:03 PM
I found the solution  :)

In the 'Heightfield shader' under the 'Displacement' tab, there I had to change the 'Interpolation method' to Stepped, Linear or Over Smooth.

That works for Geo Tiff and IMG Data.
Title: Re: Geog heightfield load makes black image
Post by: Oshyan on October 01, 2014, 11:19:18 PM
The default interpolation *should* work when the underlying data is correct though, so if anything it's just hiding the problem I think. If it works for you, fair enough. But with good data resolution, you shouldn't have any problems.

- Oshyan