Terragen Exports Bad Geometry

Started by ghoyos, August 22, 2017, 01:19:19 pm

Previous topic - Next topic


I cannot export a good mesh. Every single time it exports a mesh with holes, coplanar faces, faces overlapping, and unwelded vertices.

It looks like it's zfighting, it looks like it's all screwed up. This is in maya, max, zbrush and houdini. I've tried to solve this various ways but I cannot export a clean mesh from terragen and there's no way to clean the geo properly that I've found.

Please, how can I export a clean mesh? This seems so simple.


My Technique ...
Place your camera vertical above the area you want to export pointing down 90deg and make sure all the area ypu want is within the view.
Go to the Sequence Output tab on the render node (Far right) and tick the checkbox next to "Micro Exporter".
Add a Micro exporter and select a file name and location to save the output.
Set the render sequence to 1 frame only.
Disable atmosphere, and shadows, you can probably turn off most of the surface nodes as well.
Hit Render Sequence .
Once the file is rendered and saved I open it up in Lightwave and press "m". This merges all the polygons into a single mesh (other software will have a similar option) and give is a basic texture (I don't like the "shiny" high spec obj output but that is just a preference).
That's it.
NOTE: if you have multiple objects in your scene they will all be exported and may overlap. For instance if you have a lake or a secondary globe or sphere for an ocean they will be exported as well if they are within the view of the camera .
Hope this helps

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)


Thank you cpyhyr for your help. I wish this were in the planetside documentation. I saw this method in a forum somewhere but the problem (more of a hassle) of dealing with an enormous mesh since the area I'm dealing with is HUGE and if it weren't for the camera culling out the unseen stuff, it'd be 10 times bigger. If I used your method I could export the mesh, and then project a texture from the camera in 3ds max and delete anything outside the camera view. Still yet, I don't feel like this would guarantee faces not facing the camera would be included and the geo might be messed up still w/ coplanar faces and holes.

The method I used was this:

I imported the geometry into houdini, scaled it down to .01, dropped down a scatter SOP and converted the points to particles. Then converted the particles to VDB, dialed in the voxel size, then converted it to geometry, deleted the unnecessary faces (anything not on the top), moved it slightly down (Y axis) so it lined up perfectly w/ the original mesh and then scaled it by 100 (back to it's original scale). Then exported that into 3ds max.

Here's a file for anyone who struggles with this. https://drive.google.com/open?id=0Bwlg9iRsofu3U0g4Q1piMnhpU3M

Seems like Terragen would really benefit from a toggle switch that allowed you to turn off backface culling and leave on camera culling, and then set the distance from the camera for the area size to export. Then none of this would be necessary, since the initial problem is caused by holes in geo which I believe must be caused by the micro exporter guessing about the back faces.


Isn't it a better method to make a greyscale heightmap from TG terrain and use that to make a mesh elsewhere? Especially without lateral displacements or overhangs; they won't be rendered anyway, or would cause holes, I guess.


If you want to use tTerragen as *just* a terrain modelling package and do most of your rendering in other software then you can run into many problems. Terragens Render layers functions create multiple passes of surfaces, atmospheres, normals, motion and many more that can be used to effectively composite terragens rendered output into other softwares rendered output.
As Dune rightly says if you want to get height data to use in another program then as long as there are no overhangs a grey scale heightmap will be the way to go.
If your exporting so you have a base mesh to do detailed camer moves over then you can get away with quite low res obj exports and you can drop the render detail and AA down quite low.

Ryzen 9 3900X @3.79Ghz, 64Gb (TG4 benchmark 6:20)
i7 5930K @3.5Ghz, 32Gb (TG4 benchmark 13.44)


I export meshes frequently from Terragen and always found the best results, as Cyphr mentions, with a top down projection. Camera projections are always incomplete and as you say, full of holes and other issues.

The output meshes are particularly dirty, but you have to remember they are produced by the micropolygon renderer and as good as the output from the render, the higher the detail setting in the render the better the resolution of the mesh, but comes at a cost of file size which can become unwieldy.

A tip for reducing the micropoly file size is to turn off the texture option (UV's) in the Micro Exporter - the UV's are not much use any way (you would have to re-project them) and can reduce the file size significantly.

With this workflow I then find that to properly clean the mesh, duplicate vertices need to be removed, in fact, these meshes always have each vertex duplicated. Since Maya is exceedingly crap at dealing with mesh operations on meshes that can be very dense like terrains, I usually run the mesh through the Duplicate Vertex filer in a program called Meshlab (very quick!) and the mesh is clean. (http://www.meshlab.net/)

Another way to create a mesh and have a much cleaner output is to export a vector displacement map - see my tutorial - http://www.planetside.co.uk/forums/index.php/topic,21311.0.html

You could then import this map to displace a plane in Mudbox and have a very detailed quad mesh of your Terrain ( I see you mention Zbrush, I would imagine the proceedure is much the same) and with vector displacements overhangs and holes can be preserved.


Thanks dune, digitalguru, and cpyhr.

I definitely will try the vector displacement map next time I export and bring it into Zbrush. Sounds like a way better solution than exporting a crazy amount of data.

Thanks for making that youtube tutorial. It was EXACTLY what I was looking for. Maybe change the name of the title or description/tags so people can find it when they are having trouble exporting. In my case as a newbie to Terragen, I didn't even know you could export a displacement map, so maybe you could tag it as "how to export clean geometry from terragen" or something like that. Whoever owns Terragen should make that an official video on their website documentation.


August 23, 2017, 12:02:28 pm #7 Last Edit: August 23, 2017, 04:31:20 pm by digitalguru
Thanks ghoyos, good to hear.

Now that Terragen 4 can export a 32bit render, the quality of displacement maps (scalar or vector) will improve enormously, though I've yet to test it, it's on my to do list  :)

Edit: Just grabbed the free version to test 32bit output but it doesn't output exrs! Oh well, I'm going to upgrade my system so TGD 4 will have to wait for a bit.


We'll add that vid to the docs soon. Also note that using a *single* render thread will give you less geometry overlap (which often comes from adjacent render buckets generating the same/similar geometry).

- Oshyan


October 28, 2017, 09:19:45 pm #9 Last Edit: October 28, 2017, 09:22:45 pm by Matt
Quote from: digitalguru on August 23, 2017, 12:02:28 pm
...TGD 4 will have to wait for a bit.

@digitalguru, let us fix that for you! Can we give you a complimentary upgrade to TG4? You can send an email to support at planetside.co.uk and Oshyan will arrange for your upgrade.

Just because milk is white doesn't mean that clouds are made of milk.


October 31, 2017, 01:50:22 pm #10 Last Edit: October 31, 2017, 01:52:47 pm by digitalguru
Yes you can! Thank you so much - sent a mail to Oshyan at support.