Topic: Skyboxes Tutorial

What you will need

- Terragen
http://www.planetside.co.uk/terragen/wi … dwin.shtml
- Terragen render script
- Blender 2.56

Using Terragen

First part of the tutorial is taken from :
http://forums.virgal.net/faq-creation-m … rragen.htm

However it's in french so im gonna translate (if we can call this a translation =p)

1) Launch terragen -> customise & generate your terrain -> use the preview button
2) In the rendering window :
- Uncheck "Fixed height above surface"
- Pick the best possible quality
- Choose 512*512 as image size
http://img708.imageshack.us/img708/8793/skyboxrenderwindow.jpg
3) Open Notepad, copy/paste the script and save it as skyboxscript.tgs

initanim "C:\sky", 1
; You can set another path.
; The last part (here : "sky") is the prefix
; to name your files, and the first part
; (here : "C:\") show where you gonna save the files

;_ft
Zoom 1.0
CamH 0
CamP 0
CamB 0
frend

;_lf
Zoom 1.0
CamH 90
CamP 0
CamB 0
frend

;_up
Zoom 1.0
CamH 270
CamP 90
CamB 0
frend

;_bk
Zoom 1.0
CamH 180
CamP 0
CamB 0
frend

;_rt
Zoom 1.0
CamH 270
CamP 0
CamB 0
frend

;_dn
Zoom 1.0
CamH 270
CamP -90
CamB 0
frend

4) In terragen, click on terragen menu at the top, then "Execute script" -> select your skyboxscript.tgs
5) Once rendering is complete, open the path where you saved, and here are your 6 BMP files -> you can convert them as JPG if you want
6) Ur done!

NOTE: Take a look at the script,
Below each camera rotations there is a

;_ft (= Front)
;_lf (= Left)
;_up (= Up)
;_bk (= Back)
;_rt (= Right)
;_dn (= Down)

This is the order of your rendered images
so when you done rendering, rename them using these names so you know
what your images are.

Using Blender

If you want a little shortcut, here's a .blend file with a prepared box:
(Including Skybox.blend1 and Skybox.blend2 i dont know if they are needed to start Skybox.blend)
http://dl.dropbox.com/u/19970067/Blender/Skybox.rar

Or if it works just with just skybox.blend file :
http://dl.dropbox.com/u/19970067/Blender/Skybox.blend

And as example the 6 images i used for this tuto (2.577ko) :
http://dl.dropbox.com/u/19970067/Skyboxes/Images.rar

What i did there :
- Splitted all 6 cube faces
- Unwraped them
- Applied a material on each face, Set material "Emit" at (1.11). (thanks anael)
- Applied texture & bind UV coordinates (you just have to open your images now)
- Named faces, materials and textures UP, DOWN, LEFT, RIGHT, FRONT, BACK
- Moved each face by 0.004 / -0.004 on the correct x/y/z so the edges of the cube aren't visible
(there was a very small space at each cube edge that was visible, so like this its ok) 

From here you have to:

- Load a texture on each cube face
- Set texture for each face on UV map window (Edit mode)
http://img822.imageshack.us/img822/8189/sanstitre1tyv.jpg
- Change viewport to "Textured" (its hard to select faces when you are in texture viewport with no texture applied)
- Once all faces are textured, select face one by one and apply on each of them :
1) In Object mode -> Select a face
2) Press TAB to enter Edit mode -> in Tool shelt, under "normals" tab, press "Flip direction"
(Texture will be displayed inside of the cube instead of outside)
(In the UV menu (EDIT MODE only) use UV -> Mirror -> X Axis or Y axis if the texture isn't displayed correctly)
3) Press TAB again (to go back in Objet mode) and repeat the 1-2 steps for each cube face
- Once it's done, press "A" (select all) then export as maratis mesh (you dont have to join faces)

This is how it must look when ur done :
Outside box
http://img713.imageshack.us/img713/6680/image13243.jpg

Inside box
http://img121.imageshack.us/img121/2371/image131756.jpg


In maratis

anael wrote:

Import the mesh in Maratis, go to the behavior tab and add a "Follow" behavior. Set the camera name as the target, set delay to 0. Scale the skybox to fit the clipping max of the camera. The skybox will follow the camera position but will not rotate with it, so it's the definition of a skybox


I'm not saying that's the best way to make a skybox but it worked for me and that was quite fast & easy,
so it should work for you too.
And take note you can change settings in Terragen to make completely differents atmospheres

If you find this tuto not clear enough / possible error / better way to do it / way to improve,  just tell !

And thanks anael for showing me the way !

Results :

http://img43.imageshack.us/img43/4279/image115126.jpg
http://img638.imageshack.us/img638/2761/image115339.jpg
http://img203.imageshack.us/img203/2382/image115412.jpg
http://img52.imageshack.us/img52/4757/image115426.jpg

NOTE: in maratis, try changing the camera FOV and see the results

Last edited by Vegas (2011-03-09 14:00:52)

Re: Skyboxes Tutorial

Hi Vegas,

Very Nice tutorial, and very helpful, however.
what about people who want to make skyboxes for
commercial games? the Terra-gen website states that
the material can only be used non-commercially.

Regards Piranha

Re: Skyboxes Tutorial

Hello,

Maybe by using some free lightprobes
http://www.luxrender.net/wiki/External_resources
(HDRi section)

then apply the lightprobe as background in blender and manually take the 6 screenshots
(there are scripts to automate this task for blender 2.4x but i dont think these scripts have been ported to 2.5x)

Well thats just an idea

Re: Skyboxes Tutorial

Have a look at WorldMachine - similar to Terragen but little cheaper etc.
http://world-machine.com/download.php
Also, there are some nice skyboxes at CGTextures smile
http://www.cgtextures.com/

Hope this helps smile