Question

creating unity elevation files

  • 22 July 2016
  • 2 replies
  • 12 views

can somone plese help me recreate this process in FME to generate terrain tiles for a game engine.

https://alastaira.wordpress.com/2013/11/12/importing-dem-terrain-heightmaps-for-unity-using-gdal/


2 replies

@david_lawrence Might need a little more information to get you pointed in the right direction.

What is the input data and data type?

Possibly use a geometryfilter to pull just points if you like or lines.

Use the coordinate extractor to pull the _z attribute from the points and lines.

Push those z values out to an aggregator.

Just to help you get started. I assume there would be point generators for the endpoints on the lines and a few other items to refine the process. Finally push that out to a DEM writer.

Badge +1

Hi David, that does seem fairly convoluted so there is definitely some FME automation that can be applied here!

The first thing that comes to mind is rather than generate a height map you could use FME to make the terrain mesh. This could be done with the SurfaceModeller and writing the TINSurface out to an obj. This is a common 3d format so would probably import into unity.

If you wanted to make the height map, the RasterInterpretationCoercer is what you need. This will stretch the height values to a grey scale image, choose UInt16 as the article suggests. Im not familiar with the .raw format but I think you want the ERDAS Raw Raster Writer.

It seems that the terrain is created upside down, if so you could probably rotate the raster 180 degrees in FME too.

Either way, if you use STRM data you might want to reproject it to a local grid in metres - particularly if you make the surface.

Reply