Making Skybox With Terragen for Unity 3d

Making Skybox With Terragen for Unity 3d

Unity [Version 2.6.1 Indie]

Terragen [Version 0.9]

Using free version of the above applications.


I found necessary information from the following 2 sites beside some others:

http://developer.valvesoftware.com/wiki/Skybox_%282D%29_with_Terragen

http://www.unifycommunity.com/wiki/index.php?title=Skybox_Generator

 

Steps:

* Run Terragen. On the Rendering Control window, do

<> Uncheck “Fixed Height Above Surface”

<> Uncheck “Fixed Height Above Surface”

<> Click on “Image Size” button and set the Width & Height to 512 x 512 (uncheck “Lock Aspect Ratio” if it is already checked)

The above steps are mostly important. Rest you can try to improve the quality by changing different settings. See the image bellow:

Rendering-Control

As you can see above “Land” was unchecked to render the images quickly. This will make the bottom of the image black. Not much important as this part can be hidden by the Unity terrain. Anyway you may check the Land box and use terragen to generate hills/water etc or use any other graphics program to remove this (Copy a portion from the above, Flip vertically and Paste here).

 

* Copy the following script and save it on your computer as skybox.tgs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

initanim "C:\skybox-front-", 1
Zoom 1.0
CamH 0
CamP 0
CamB 0
frend

 

initanim "C:\skybox-back-", 2
Zoom 1.0
CamH 180
CamP 0
CamB 0
frend

 

initanim "C:\skybox-left-", 3
Zoom 1.0
CamH 90
CamP 0
CamB 0
frend

 

initanim "C:\skybox-right-", 4
Zoom 1.0
CamH 270
CamP 0
CamB 0
frend

 

initanim "C:\skybox-up-", 5
Zoom 1.0
CamH 0
CamP 90
CamB 0
frend

 

initanim "C:\skybox-down-", 6
Zoom 1.0
CamH 270
CamP -90
CamB 0
frend

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

 

* On Terragen menu click “Terragen->Execute Script” and select the saved script – “skybox.tgs”. This will make 6 images on your c:\ drive

skybox-front-0001.bmp
skybox-back-0002.bmp
skybox-left-0003.bmp
skybox-right-0004.bmp
skybox-up-0005.bmp
skybox-down-0006.bmp

* Copy these files to your Unity Assets folder.

 

* On Unity’s Project pane select each file and on the Inspector pane set their Wrap Mode to Clamp.

 

* Click on “Assets->Create->Material”. On the Project pane rename the “New Material” to “NewSkybox”. On the Inspector change the Shader of NewSkybox to RenderFX->Skybox.

 

From Project drag the “skybox-front-0001.bmp” to Inspector’s Texture2d for Front. Do same for the other images.

 

* Click Main Camera on the Hierarchy pane to select it. Click on the menu Component->Rendering->Skybox. On the Inspector select NewSkybox for the field Custom Skybox.

 

Now there should be the new skybox.

To improve the image quality, open Terragen’s Rendering Control window. Click on Render Settings button, on the Quality tab set the Accuracy to High.

There are some videos for terragen tutorial on youtube you may see. You may also take a look:

http://update.multiverse.net/wiki/index.php/Creating_Skyboxes_with_Terragen

 

Thank you.

5 comments

  1. Pingback: » Criação de Skyboxes para Unity3D utilizando o Terragen 2 Computação Gráfica
  2. Pingback: Computação Gráfica » Criação de Skyboxes para Unity3D utilizando o Terragen 2
  3. Pingback: Criação de Skyboxes para Unity3D utilizando o Terragen 2
  4. Pingback: Unity3D and Terragen 2 Skybox « Joel Dauncey

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s