Author Topic: Terragen -> Unity for a very basic game test.  (Read 226 times)

Offline Jgone

  • Member
  • *
  • Posts: 52
Terragen -> Unity for a very basic game test.
« on: February 07, 2018, 09: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.

Offline bobbystahr

  • Member
  • *
  • Posts: 8508
  • Turn, and face the Strange Ch Ch Changes...D Bowie
Re: Terragen -> Unity for a very basic game test.
« Reply #1 on: February 07, 2018, 09:01:04 PM »
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
something borrowed,
something Blue.
Ring out the Old.
Bring in the New

bobbystahr

Offline Jgone

  • Member
  • *
  • Posts: 52
Re: Terragen -> Unity for a very basic game test.
« Reply #2 on: February 12, 2018, 05:34:55 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  ???

Online cyphyr

  • Member
  • *
  • Posts: 3714
    • richardfraser
Re: Terragen -> Unity for a very basic game test.
« Reply #3 on: February 12, 2018, 07: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
www.richardfraser.co.uk
https://www.facebook.com/RichardFraserVFX/
/|\

i7 5930 @3.5Ghz, 32Gb
i7 2600k @3.4Ghz, 16Gb
i7 980 @3.33Ghz, 16Gb

Offline KlausK

  • Member
  • *
  • Posts: 336
  • Land ho!
Re: Terragen -> Unity for a very basic game test.
« Reply #4 on: February 12, 2018, 12:42:57 PM »
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
« Last Edit: February 12, 2018, 12:51:33 PM by KlausK »
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 780 / Win7 Ultimate

Offline agent unawares

  • Member
  • *
  • Posts: 42
Re: Terragen -> Unity for a very basic game test.
« Reply #5 on: February 14, 2018, 04: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.

Offline Jgone

  • Member
  • *
  • Posts: 52
Re: Terragen -> Unity for a very basic game test.
« Reply #6 on: February 14, 2018, 10: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