Planetside Software Forums

General => Terragen Discussion => Topic started by: Jgone on February 07, 2018, 05:37:23 AM

Title: Terragen -> Unity for a very basic game test.
Post by: Jgone on February 07, 2018, 05:37:23 AM
Hello. Tried googling this but didn't find any recent posts about it so i decided to open one of my own.

I'm currently at school, we have few months of game development, we gotta create super super simple basic games to pass the class.

Anyone got experience how to import a simple terrain from terragen to Unity3D ? Or is it even possible ?
The class is super basic, and so is the game. So if it takes like 30 steps to import a scene to unity then it might not be worth it.

I'm sure there are some restrictions involved, but i've read that people can import skyboxes from terragen to Unity, but i guess that's a different story.
Title: Re: Terragen -> Unity for a very basic game test.
Post by: bobbystahr on February 07, 2018, 05:01:04 PM
Quote from: Jgone on February 07, 2018, 05:37:23 AM
Hello. Tried googling this but didn't find any recent posts about it so i decided to open one of my own.

I'm currently at school, we have few months of game development, we gotta create super super simple basic games to pass the class.

Anyone got experience how to import a simple terrain from terragen to Unity3D ? Or is it even possible ?
The class is super basic, and so is the game. So if it takes like 30 steps to import a scene to unity then it might not be worth it.

I'm sure there are some restrictions involved, but i've read that people can import skyboxes from terragen to Unity, but i guess that's a different story.

try this thread

http://www.planetside.co.uk/forums/index.php/topic,10716.msg110188.html#msg110188
Title: Re: Terragen -> Unity for a very basic game test.
Post by: Jgone on February 12, 2018, 01:34:55 AM
Quote from: bobbystahr on February 07, 2018, 05:01:04 PM
Quote from: Jgone on February 07, 2018, 05:37:23 AM
Hello. Tried googling this but didn't find any recent posts about it so i decided to open one of my own.

I'm currently at school, we have few months of game development, we gotta create super super simple basic games to pass the class.

Anyone got experience how to import a simple terrain from terragen to Unity3D ? Or is it even possible ?
The class is super basic, and so is the game. So if it takes like 30 steps to import a scene to unity then it might not be worth it.

I'm sure there are some restrictions involved, but i've read that people can import skyboxes from terragen to Unity, but i guess that's a different story.

try this thread

http://www.planetside.co.uk/forums/index.php/topic,10716.msg110188.html#msg110188

Hey, thanks for the tip. The post didn't quite help me out, but it helped me to understand some things. :)
I tried importing an fbx (via micro importer) and opened it in Unity but it doesn't work.
I guess it must be more complex than i'm imagining  ???
Title: Re: Terragen -> Unity for a very basic game test.
Post by: cyphyr on February 12, 2018, 03:46:02 AM
I don't know Unity but I would imagine that it can import height maps that can displace the base Unity terrain.
You can generate a height map by plugging your terrain into  the shader input of either a "Heightfield generate" node or a "Heightfield from Shader" node. Then right click on the node and select Save as ... You will have the option of saving as either a .ter (terragens native terrain format) or an .exr. Choose the .exr. You can ten import this into Unity or edit it further in Photoshop.
Hope this helps
Title: Re: Terragen -> Unity for a very basic game test.
Post by: KlausK on February 12, 2018, 08:42:57 AM
Hi
You might want to search the forum for the term "microexporter".
This is in no way meant as some kind of "rtfm" ;) but it will give you links to threads dealing with exporting terrains in a wide variety of scenarios.

And yes, the simplest way to export is using the microexporter and saving the resulting file as a *.obj.
Again, read up upon the microexporter and how it works.

I`ve attached a few pictures from a Unity scene where I imported a microexporter generated terrain as *.obj.
To microexport the terrain I used a spherical camera in TG (perhaps only available in the Pro-version - but ortho-
or perspective camera work well too), relatively high render quality settings of AA 6 and Micropoly detail of 0.6.
As I said camera=spherical and Far distance set to 1000m. This resulted in a *.obj of 612mb and roughly 1.8 mill polygons.
The TG Wiki explains how different render settings influence the microexporter.

Import into Unity was no problem (Import New Asset) but Unity split the object up into ~30 groups.
A obj imported is allowed to contain about 65000 polys or something, I think. That is what is in the attachments.

So, yes it is easy but you`ll have to do some clean up and figure out which degree of resolution you need in the game engine
before you export from TG. But I am by no means an avid user of Unity nor TG. Just curious to look into these kinds of problems
and find my way around :) Hope it helps a little.
CHeers, Klaus
Title: Re: Terragen -> Unity for a very basic game test.
Post by: agent unawares on February 14, 2018, 12:37:38 AM
I wouldn't use the microexporter because it involves all kinds of unnecessary cleanup. Generate a heightmap and use it with normal Unity terrain.
Title: Re: Terragen -> Unity for a very basic game test.
Post by: Jgone on February 14, 2018, 06:43:05 AM
Thanks a TON all of you. Now i feel confident that i'm able to produce something for our little game.
The users on this forum has got to be the most helpful ones out there.  ;D