FSX Ugly terracing effect

Horst18519

Moderator
Staff member
Resource contributor
#1
Images say more than words, so take a look at the screenshots.

I made a custom GeoTIFF file with a rather high resolution, but in FSX I get the results you see - one with FSX set to 1m mesh resolution, the other with 5m.

How can I get rid of the terracing effect? The fractionbits thing mentioned in the SDK did not help here.

Any ideas?
 

Attachments

#2
Custom made Geo-Tiff? Uh, oh!

What resolution were your trying to achieve? If you started with another source, what was it's resolution?
 

Horst18519

Moderator
Staff member
Resource contributor
#3
It is in fact a 3D mesh in 3ds max. I applied a material that gives the mesh a gradient height profile and rendered it (8192x8192), exported it as a TIFF, edited it in Photoshop so I get values from 0 to 255 and resampled it.
 

Horst18519

Moderator
Staff member
Resource contributor
#6
Here it is (it's just a part of the image though, saved as JPG).

Reducing it to 20% or even 5% teh size did not help, I guess there's something I did wrong here.

I'll show you the INF as well:

[Source]
Type=GeoTIFF
Layer=Elevation
SourceDir="."
SourceFile="MI_Mesh_7.Tif"
Lat=0.1000000000
Lon=0.1000000000
CellXdimensionDeg=0.000011
CellYdimensionDeg=0.000011
ScaleInMeters=1.4
BaseValue=

[Destination]
LOD=Auto
FractionBits = 5
DestDir="."
DestBaseFileName="MI_Mesh_7"
UseSourceDimensions=1
 

Attachments

#7
This thing compiles where you want it to be?

Your .INF file declares the source to be a GeoTiff. AFAIK, Photoshop does have a plug-in that will deal with GeoTiff files. Otherwise what you think is a GeoTiff is really just a TIFF file.

Your Lat/Lon places you in the Gulf of Guinea. Is that correct? I only see a bunch of sea there... :confused:

Your line of "ScaleInMeters=1.4" is suppose to do what? The Scale toggle is used to adjust from feet to meters or something to meters, as that's what Resample processes data into.

Your lines for xDim and yDim are non-conforming to the SDK's "xDim = .xxxxx" format.

You understand that the FractionBits setting reduces the range of values in the source? If your intention is finer rendering, do you really need to go down to 3 CENTIMETERS? Especially on a 1 meter source file? By using a FB of 5 your elevations top out at 1,024 meters. Anything above that and you'll have a big hole. A really BIG hole, about 32,767m deep! Been there, have the T-shirt.

When you saved the file was it at 8 bit or 24 bit? You mention setting a gradient and values of 0 to 255. This to me denotes 8 bit, whole meter increments. Without better values in the source, the FractionalBits settings is trying to put lipstick onto a pig. Maybe that's what the first picture is telling you?

Sorry for bouncing around on the points, but my mind is bouncing back and forth over a house selling / moving.
 
#8
Hi Thorsten:

Your JPG attached above is 24-bit, but I wonder if the "GeoTIFF" used with Resample was actually only 8-bit data ? :confused:


FS SDK Resample creates strange mesh if given 8-bit data; results are even more strange if FractionBits is used with such input data. ;)


Perhaps this might be of some interest as a comparison (fascinating effect, though ! :p):

http://www.fsdeveloper.com/forum/showthread.php?t=16629


Hope this helps ! :)

GaryGB
 
Last edited:

Horst18519

Moderator
Staff member
Resource contributor
#10
Don't worry about the direct feedback, it's good to see someone really took a look at it. :D

The gradient function in 3dsmax does not map values from 0 to 255, it's a gradient from black to white that is then rendered in 24bit, so there should be no real terracing effect in the TIF file (as you can see in the JPG above).

Now the scene I want to render is a small island ranging from 0 to around 400. If I'm not mistaken I need the "scale" value to enlarge the range of the mesh, isn't that so? How do I create a mesh ranging from 0 to more than 255 meters without adjusting the scale?

The fraction bits line was used in order to get rid of the terracing effect, but unfortunately it did not change anything. So of course you'Re right, it is not necessary - but then, where's the error?

Maybe I shouldn't use GeoTIFF? Is there another way? Creating a ras-file? How do I do that?
 

Horst18519

Moderator
Staff member
Resource contributor
#11
Ok, after some claps-to-the-forehad I think I understood some things about this TIFF thing:

- GeoTIFFs seem to have some geo data coded into the file - no idea where, but it must be somwehere
- TIFFs do not have this, hence the difference in the INF file
- 32bit is a lot more than 24bit, but unfortunately you can't see all this on your screen because all 32bit values above 1.000 are displayed simply white

and most of all:

- rendering something into a 24bit image and then save as 32bit does not make it a 32bit file. :eek:

Does anybody know a way of rendering 32bit images from 3ds max?
 

Horst18519

Moderator
Staff member
Resource contributor
#13
That looks nice indeed. I wonder if it's possible to use it for my project.

The main idea of my project is: I create an island in 3ds Max and create an FSX mesh that has exactly the same shape, so I can easily create a scenery in 3ds max that fits perfectly onto the mesh.

I'm starting to be afraid there's no way achieving this. :(
 
#14
Is the island terrain entirely fictional ?

If not, is the existing (afforable / free) DEM data too low in resolution ? :confused:


BTW: Regardless of intermediate methodology used to create the terrain data, submitting a GeoTIFF to Resample as the final format can simplify creating one's INF file, but one must be sure the source data file is not only geo-referenced properly, but also projected in Geographic Lat-Lon WGS84 format. ;)

GaryGB
 
Last edited:

Horst18519

Moderator
Staff member
Resource contributor
#15
The island is completely fictional, created in 3ds max.

It seems there's no way of getting the mesh data out of Max without rendering it into 24bit, which means greyscale 0-255, hence the steps in the mesh.
The gradient material in Max is in fact 24bit 0-255, I only just discovered that. It's not possible to use 32bit there.

I guess the only way would be to "slice" the mesh and render the parts individually, putting them together in Photoshop - something that's almost impossible considering I have to work with data that's completely white on my screen. :banghead:
 

rhumbaflappy

Moderator
Staff member
Resource contributor
#16
I would convert any elevation "image" to 8 bit. I think global mapper allows the importation of 8 bit png files as elevation...

Maybe I can play with this today. but you's almost be better off converting imagery points to 16 bit signed integers via a program. Visual basic or c# could co it... or java or a script program.

Resample usually gets 16 bit signed data as elevation.

Dick
 

Horst18519

Moderator
Staff member
Resource contributor
#17
That's an interesting approach.

I have just had a major breakthrough though. If I save the render as a 16bit greyscale I get values from 0.000 to 1.000, that means if the island has an altitude range from 0 to around 250m I should be able to get a mesh with an altitude resolution of around 25cm. I tried it - and it works! :)

I can now even see the individual polys of my mesh, that's so cool. :D

If I show you the INF file you won't belive that this actually works:

[Source]
Type=TIFF
Layer=Elevation
...
CellXdimensionDeg=0.000022
CellYdimensionDeg=0.000022
Scale=500
[Destination]
FractionBits = 6
...
UseSourceDimensions=1
 

Horst18519

Moderator
Staff member
Resource contributor
#19
Still trying to figure what happens in Photoshop though. I try to calculate the 0.000-1.000 values into 0.0-250.0 values, but I can't seem to find an option that can do this. I always get high peakes, like in a square function.
 

Horst18519

Moderator
Staff member
Resource contributor
#20
Ok, I got it now. I went back to 32bit greyscale, did not edit the file in Photoshop at all and just played with the scale and fractionbits values. The result is rather ok, after I turbosmoothed the mesh in Max and re-rendered it. :)
 

Attachments

Top